How do I force the New Line in a text box to retain the new line in an email

How do I force the New Line in a text box to retain the new line in an email

How do I force the New Line in a text box to retain the new line in an email
divider

You have two possibilities to Format text areas to mail line-breaks.

1. Interakt Method

To do this, you must add a BEFORE custom trigger in which to write:

$tNG->setColumnValue("contentField", nl2br($tNG->getColumnValue("contentField")));

2. php Method

Put this just before the start of the email trigger definition

$_POST['Damage_History'] = nl2br($_POST['Damage_History']);

However, if you do this and later you try to edit the record, you will see <br> in the textarea, and not new lines.
This can be sorted with this:

$text = $row_rs["contentField"];
$breaks = array(" ","<br />","<br>","<br/>","<br />","&lt;br /&gt;","&lt;br/&gt;","&lt;br&gt;");
$text = str_ireplace($breaks, "", $text);
Written by:  - 28 Sep, 2009