- This topic has 3 replies, 2 voices, and was last updated 5 years, 6 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘Generic’ is closed to new topics and replies.
Events Made Easy › Forums › Generic › Line breaks stripped from email when inside table
Hi,
I have set emails to be sent in html, then made a template (type ‘General email) with automatic line breaks. This worked fine, emails were sent and received correctly.
But then I decided to put the template code inside a html table, but now when I open the template in the email editor, all line breaks have gone and it’s one long line of text.
I tried hard-coding line breaks and paragraphs into the template, but they all get stripped upon sending the email. The exact same code works correctly when I put it outside the table.
Am I correct to assume that line breaks and paragraphs are stripped by default inside a table? Any way to work around this?
Thanks, cheers,
Leo
While it is wordpress that is removing the br-tag (see e.g. https://stackoverflow.com/questions/13327100/preventing-wp-from-removing-br-and-p-tags), I’m trying to be as intelligent as possible and add br when needed.
See if this change helps:
https://plugins.trac.wordpress.org/changeset/2090950
Great, this really does the trick as far as I’m concerned!
The behaviour around paragraphs and line breaks appears quite unpredictable at times (for instance there’s a line break inserted after each div for some reason), and it’s hard to tell if it’s caused by EME or WP. But through trial and error I got it working just fine.
Many thanks again!
Here’s another set of changes that will improve a bit how it works in eme:
https://plugins.trac.wordpress.org/changeset/2090973/events-made-easy/trunk
But: if you created your template in the “quick tags” editor of WP, but later on load that template in the visual editor, the layout might change (and that’s wordpress: just swith between both editors when you added a br-tag, you’ll see).