Whatsapp button message with line break in the message

Hi there,

I have a Whatsapp button which allows users to send a message to other people.

It works fine, but I cannot work out how to add a line break in the message.

Can anyone suggest a way of doing this?

This is my code:

<a href="whatsapp://send?text=Hi, '\n' I found this and thought you might like it: '\n' <?php the_job_permalink(); ?>" class="botao-wpp"><i class="fab fa-whatsapp"></i></a>

I;ve tried using: '\n'

but it just displays the actual code.

Thanks

I don’t know if it will work but you could try this:

<a href="whatsapp://send?text=Hi, %0D%0A I found this and thought you might like it: %0D%0A" class="botao-wpp">

1 Like

Many thanks, that worked :slight_smile:

I have another question, but it’s more Wordpress related.

Is it possible to insert a link within the message so the URL isn’t displayed?

Something like this in HTML:

<a href="<?php the_job_permalink(); ?>"><?php wpjm_the_job_title(); ?></a>

But inside the following:

<a href="whatsapp://send?text=Hi, %0D%0A %0D%0AI found this and thought you might like it: %0D%0A %0D%0A<?php the_job_permalink(); ?>" class="st-custom-button whatsapp"><i class="fab fa-whatsapp"></i></a>

Thanks

Not my area I’m afraid so maybe someone else can jump in :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.