Site logo

[Support request] gb button with custom field dynamic link to send whatsapp message

Home Forums Support [Support request] gb button with custom field dynamic link to send whatsapp message

Home Forums Support gb button with custom field dynamic link to send whatsapp message

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #2177762
    Michael

    Hi im trying to create whatsap link in custom field text with line break.
    but the message in whatsapp is always a single line, the syntax is:
    https://api.whatsapp.com/send?phone=<xxx-xxx-xxx>&text=firstline%20secondline

    the output is :
    firstline secondline

    what im trying to achive
    firstline
    secondline

    any solution? thank you

    #2177786
    Ying
    Staff
    Customer Support

    Hi Michael,

    Do you mean you added the text like this? And the <br>tag is missing?
    <p>Chat on WhatsApp with <br><span class="">xxx-xxx-xxx</span></p>

    Let me know!

    #2178244
    Michael

    no, i will put my weblink in the private info.
    try whatsapp button that will open whatsap chat message in mobile
    i want the message with line breaks
    firstline
    secondline

    but the result always one line sentence
    firstline secondline
    i put the other website that have send whatsapp message that send message with line breaks

    #2178249
    Michael

    this is the syntax that i put in the post meta->custom fields
    https://api.whatsapp.com/send?phone=xxxxxxxxx&text=Ref:abcdefirstline%20secondline
    and in the header , gb button code is dynamic options->dynamic link->meta field name
    and somehow the result copy link from the button in live website is
    https://api.whatsapp.com/send?phone=xxxxxxxxx&text=Ref:abcdefirstline%20secondline (no linebreak)

    #2178282
    Fernando
    Customer Support

    Hi Michael,

    It would be best to reach out the the support of Whatsapp with regards to this as this is out of our scope.

    Here is an article with regards to our scope of support: https://generatepress.com/what-support-includes/

    Thank you for understanding. 🙂

    #2178333
    Michael

    Hi fernando, thank you for your response.
    but i believe the problem is in the header , gb button code is dynamic options->dynamic link->meta field name

    if i set the link directly in the gb button, this code
    https://api.whatsapp.com/send?phone=xxxxxxxxx&text=Ref:abcdefirstline%20secondline
    return corectly in the live website (2 lines)

    but if i put the link in the post meta->custom fields
    above code is somehow transform into
    https://api.whatsapp.com/send?phone=xxxxxxxxx&text=Ref:abcdefirstline%20secondline (no linebreak)

    #2178346
    David
    Staff
    Customer Support

    Hi there,

    GP uses the core get_post_meta function to retrieve the value of the post meta ( custom ) field. It doesn’t interfere with the content of that field. So if the output link is different to the custom field value then something else is interfering with that.

    If you inspect the link using the browser developers tools ( Right Click > Inspect the link ) – is the Post Meta link different to the Static Link ?

    #2178404
    Michael

    its different.
    what i put in the post meta and live website whatsapp button link

    #2178487
    David
    Staff
    Customer Support

    OK – so GP uses esc_url for any links it outputs this is primarily for security and it is that WP function that is stripping part of the URL ie. this %20%0AWA2%20 becomes %20WA2%20.
    There is something that WP doesn’t like about that string. You may want to find an alternative URL encoding to output what you need.

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