I guess you could try putting
and
around the text field.
Hope that helps. If you have any questions, please let me know!
Hi @lapzor thanks for your fast response.
I’m not entirely sure what you mean with that. My message looks like this now:
<p>First name: [FNAME]</p>
<p>Last name: [LNAME]</p>
<p>E-mailaddress: [EMAIL]</p>
<p>Phone: [PHONE]</p>
<p>Message:</p>
<p>[MESSAGE]</p>
When someone uses the contact form and writes in the message:
Hi,
This is a test.
Bye
I get in my mailbox:
Hi,This is a test.Bye
I just want the message to keep the blank lines…
Instead of
<p>[MESSAGE]</p>
try
<pre>[MESSAGE]</pre>
Hope that helps. If you have any questions, please let me know!
Thanks.
That works, but preformatted text is not a pretty solution because the style is different than the rest of the fields 🙁
Is there really no other way ?
It depends on your email client…
You could see what the following example does in your email program:
<p style="white-space: pre;">[MESSAGE]</p>
Another option is to add this code to your functions.php
add_filter(
'hf_action_email_message',
function( $message ) {
return nl2br($message) ;
}
);
Personally I use the https://wordpress.org/plugins/code-snippets/ plugin instead of editing my child-theme file.
Hope that helps. If you have any questions, please let me know!