Sanford Whiteman

Newlines to <BR>s in Velocity

Blog Post created by Sanford Whiteman on Nov 25, 2016

When you output a textarea token in an HTML email, you might be surprised that its linebreaks go bye-bye. This really should be expected, as newlines are typically swallowed in HTML unless you have specifically ordered otherwise.


One fix is to use a CSS white-space style override.  I believe that style is honored in all modern mail clients, but you've required the email author to remember to always wrap that token in certain formatting.  Better, I'd think, to give them a token that's already HTML-aware.

Read the full post on TEKNKL :: Blog →