Maintain line breaks when sending email as HTML in FormBuilder

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
tomgsd
Forum Members
Forum Members
Posts: 74
Joined: Tue Feb 12, 2008 10:00 am

Maintain line breaks when sending email as HTML in FormBuilder

Post by tomgsd »

Just a very quick one here:

If someone fills out a form and adds line breaks, by default these are shown as a single line in the email and on the results page.

Solve this by adding "|nl2br:true" as a modifier on your smarty message variable in both the submission and email template.

Eg, {$message|nl2br:true}

The new lines get converted to
's and you see the intended formatting.
Green Sheep Design Ltd. - www.greensheep.co.uk
Post Reply

Return to “Tips and Tricks”