Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By springhigh
#813695
Hi.
When using a @#Textarea for the body of an emial that gets sent out with a trigger, what shows in the email seems to remove all of the formatting that was captured in the textarea. Specifically any breaks, new lines etc.

So this textarea:-
Line 1
Line 2
Line 3

Comes out as this in the emial:-
Line 1 Line 2 Line 3

Any ideas on why this could be happening ?
User avatar
By amosbatto
#813703
Which version of PM are you using?

There are a couple solutions to this problem:
Use this HTML in your template:
Code: Select all
<pre>@#myTextArea</pre> 
or
Code: Select all
<textarea>@#</textarea>
Note that this code has to go in the HTML code, not in the graphical editor.

Another solution is to add this trigger to your process:
Code: Select all
if (isset(@@myTextArea)) {
   @@myTextAreaHtml = preg_replace("/\r?\n/", '<br>', @@myTextArea);  
} 
Set this trigger to fire before the point where the email is sent.

Then, use this text in your template:
Code: Select all
@#myTextAreaHtml
By springhigh
#813714
Thank you Amosbatto

Just what i needed

I found the <pre> element works best, but the font comes out as monospace in the emials.
This can be changed through css below in the email template

<style>
pre {font-family: Georgia !important;}
</style>

In the rapidly evolving world of online sports be[…]

STEPN integrates social networking and games that […]

Cenforce 150 is a medication used to cope with a c[…]

What's SAP FICO?

Trustworthy and skill-building, each of these actu[…]