I am trying to set up a support form with input fields and a textarea where our customers can submit there problems.
After the customer submits the form, our support team gets an email with all the form fields. Easy so far.
Now I have the problem, that line breaks within the textarea are not interpreted as such in the email.
The text from the textarea is one big paragraph in the email.
Any ideas how the line breaks can be displayed?
Thanks for your help!
Do a search for that. I believe someone fixed this somewhere.
But it may not be fixable easily.
Also, i'd suggest using SFDC Cases or an actual support tracking tool instead.
Florian, to be clear, there isn't a bug here, because the way newlines are entered into textareas is supposed to be different (by design) from the way you force newlines in HTML. Or maybe to put it another way, the text in a textbox isn't HTML, so you naturally have to change it if it's going in an HTML email.
Note you will be permanently altering the field this way. I expect that's not a problem for your case.
I tried to implement your suggested solution in my setup. And this becomes not that easy since we are using Marketo forms inside Marketo landing pages which is placed in a iFrame.
I never used email scripting before, but this token really did the trick.
Since I want the line breaks to be displayed in an email, I used the following code as a email scripting token:
$lead.temporaryNotes.replaceAll("\n", "<br />")
Very simple. Never thought about it before.
Email scripting will work, too, but of course that doesn't fix up the display for a LP (i.e. including the field as a token).
It'll work fine in an IFRAMEd LP. Just use the whenReady event in an HTML block in place of the onReady.