• Resolved supervinnie41

    (@supervinnie41)


    Hi,

    I just had a great idea that I have been trying to build (but still unsuccesfull). It might be something you could put on the list?

    With CFF we can build forms with various goals, something to sent something like an e-mail orso. But these days there is much more then just e-mail (Signal, Whatsapp etc.).

    Why not make an option to build a button to sent the information from the form via Whatsapp. Either by a predefined number, or via the number entered in the form.

    For example:

    <a target="_blank" >
    Sent this form to yourself via Whatsapp
    </a>

    Or perhaps:

    <a target="_blank" >
    Sent this form to us
    </a>

    Just from the top of my head you can give the user in the backend these options:

    • Where to sent (fieldname also accepted)
    • List of fieldname to include in the message to sent, with 2 columns: text | fieldname
    • Maybe some settings to ensure the phonenumber is formatted correctly?
    • Text to show in the button
    • Optional: icon to show in the button (before or after text)

    I’m sure you can think of much better options, such as including bold text (incase in *) or other stuff. The example above is for Whatsapp, because I have been trying to get that working, but I’m sure this could work great with Signal, Messenger and others.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @supervinnie41

    Thank you very much for the suggestion. The links you are referring to does not send the information via WhatsApp, it opens WhatsApp and the user must send the message manually. The send the messages automatically, you must use the WhatsApp APIs by you would require a WhatsApp business account.

    The “WhatsApp Button for Calculated Fields Form” complementary plugin (https://cff-bundles.dwbooster.com/product/whatsapp-button) allows you to open a communication channel with your customers via WhatsApp.

    Best regards.

    Thread Starter supervinnie41

    (@supervinnie41)

    Hi,

    That add-on seems to largely do what we had in mind. Although the page doesn’t very clearly explain what its effect is.

    We’ll have a look at it to see wether it is close enough for us to buy.

    We just want our visitors to have the option to either sent the form to themselves via mail or via Whatsapp. (including the info entered in the form)

    Plugin Author codepeople

    (@codepeople)

    Hello @supervinnie41

    No, I’m sorry, the feature you are requesting requires implementing the integration to WhatsApp via API, and the WhatsApp API is available only on WhatsApp Business Accounts. The WhatsApp button displays the WhatsApp button in the public form to allow the users to contact you via WhatsApp, and the Professional version of the CFF includes a button in the entries list to enable you to contact the users via WhatsApp.

    Best regards.

    Thread Starter supervinnie41

    (@supervinnie41)

    Hi,

    I understand that the API might not be the best option, but this (below) would work if only you could render the %info% and %fieldname1% as rawurlencode. To me this seems the closest working option to achieve an option to sent the form to yourself (without the need for api’s and other difficult stuff).

    This:

    <a target="_blank" >
    Sent this form to yourself via Whatsapp
    </a>

    Would then (in the frontend) become something like:

    <a target="_blank" >
    Sent this form to yourself via Whatsapp
    </a>

    In Whatsapp this would look something like this:

    Name: Supervinnie1, Contact me: yes, Phone: 0031612345678, Interessed in: getting quote for software package.

    Or:

    Sent this form to yourself via Whatsapp

    When the link is clicked it either opens Whatsapp on your phone or the web.Whatsapp website in your browser (new tab). Yes, you’d still actually have to press the “send” button, but you’ll get exactly what you want.

    The only other option I can think off (which requires coding that I don’t understand) would be something more like a “share” button that also includes Whatsapp. But I’m not sure if this would work on a desktop? The above works well if only you can render “%fieldname1%” and “%info%”. I have been trying to get exactly this to work, but I haven’t been able to actually get the values to render. On the frontend I just get “%fieldname1%” instead of the value that is entered in the form.

    Thread Starter supervinnie41

    (@supervinnie41)

    Sorry, I seem to have made a typo in the clickable link in my post above. It should be this:

    Sent this form to yourself via Whatsapp

    I don’t see how to edit a link…

    Plugin Author codepeople

    (@codepeople)

    Hello @supervinnie41

    If you want to include a button in the form to navigate to an URL similar to:

    <a target="_blank" >
    Sent this form to yourself via Whatsapp
    </a>

    You can generate it yourself as part of your form.

    Insert a calculated field in the form as an auxiliary to generate the URL (I’ll assume this is the fieldname123), you can hide this field by ticking a checkbox as its settings, and enter an equation similar to (the following ):


    (function(){
    let phone = fieldname1;
    let text = CONCATENATE('Hello ', fieldname2, ' you have entered the information ', fieldname3);

    return generateURL('https://api.whatsapp.com/send', {'phone': phone, 'text': text});
    })()

    Finally, insert a button field in the form and enter the following piece of code as its onclick event:

    window.open(getField('fieldname123').val(true, true), '_blank');

    Learn more about the operations used in the equation and button code by reading the operations module in the plugin documentation:

    https://cff.dwbooster.com/documentation#modules

    Best regards.

    Thread Starter supervinnie41

    (@supervinnie41)

    Thanks, that is a roughly what I am looking for :-).

    It needs to be finetuned by adding more fields, and I need to make something that makes sure that the phonenumber is the correct format. But I’m sure I’ll get that working.

    Thanks for the working code.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.