Rate this article

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

Rating: 4.7/5 (3 votes cast)

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:
<?php echo str_replace("<br>", "\n", $row_rs["contentField"]); ?>

Adobe

XMS Systems
ionCube Online PHP Encoder
Free PositiveSSL and WhoisGuard with Every Domain Purchase

Although we try to ensure all the articles submitted are valid it is your responsibility to make sure you have backups before you use these suggestions on your pc or websites.
We do not take any responsibility for any data-loss, loss in functionality or any problem that might arise in what-ever way or form by making use of the information on this site.

"Friends of Interakt" has no connection to the Adobe Interakt Company