Recent searches


No recent searches

Mystery Line Breaks (<br />'s) Before Tables in Trigger Emails

Answered


Posted Feb 11, 2022

I am trying to add an HTML table to an email that is sent by a zendesk "trigger". While designing the email, I have noticed that Zendesk (or the Liquid templating engine) is adding mystery line breaks (<br />'s) to the email, right above any table that is added, and the number of <br />'s added depends on how many elements are in the table. 

For example, if I add a small 1-row table to the body of my trigger email, like this one...

<table>
<tr><td>This is a small table</td></tr>
</table>

...then Zendesk adds 2 mystery <br />'s to the email, right before the table, like this...

If the table has a bit more content, like a 5 row table, like this...

<table>
<tr><td>This is row 1.</td></tr>
<tr><td>This is row 2.</td></tr>
  <tr><td>This is row 3.</td></tr>
  <tr><td>This is row 4.</td></tr>
  <tr><td>This is row 5.</td></tr>
</table>

...then Zendesk adds 6 mystery <br />'s to the email, right before the table, like this...

As you can imagine, this has a big negative effect on the formatting of the email. The table I'm hoping to add has ~14 cells in it, and when the email is delivered, is has a massive white space right above the table because Zendesk is adding a whopping 15 mystery line breaks to the email.

Has anyone ran into this before? Might there be a workaround to still being able to use HTML tables, but not have these line breaks added?


1

8

8 comments

image avatar

Bry Fitzgerald

Zendesk Customer Care

Hey Jake! I've replied in your ticket to get some more information. For anyone else that's following this, I'll be sure to report back once I learn more.

0


I'm experiencing this exact same issue - line breaks added before a table in a trigger email. Please could you let me know if there were any workarounds or other updates when this was looked at previously?

0


image avatar

Hiedi Kysther

Zendesk Customer Care

Hi Ola Timpson,

Due to the nature of your issue, I created a ticket on your behalf so we can troubleshoot this issue together. Please check your email for more information. Speak soon! 

0


We're continuing to have the same issue. We are going to try and work around it by changing the `br` styles but it would be nice to get this resolved!

0


Hi! Same here. Added <br />-s are breaking html layout. One workaround is to use minified html without line breaks. But it would be better to be able to just disable the adding of breaks.

0


Anything further on this?

Still affected by this.

0


image avatar

Brett Bowser

Zendesk Community Manager

Hey Jared, I'm gonna create a ticket on your behalf so our Customer Care team can look into this with you.
 
You'll receive an email shortly stating your ticket has been created.
 
Cheers!

1


Hi all.  As noted in the documentation there are instances where gaps or spaces may occur from the html.
Where can I use Markdown and HTML in Zendesk Support



So, if you “minify” your code this should work. Minifying basically means is you just squish it all together in one long string. 
So in the example from this posting, it would look like this instead:  (this should remove any line breaks)

<table><tr><td>This is row 1.</td></tr><tr><td>This is row 2.</td></tr><tr><td>This is row 3.</td></tr><tr><td>This is row 4.</td></tr><tr><td>This is row 5.</td></tr></table>

There are several “minifiers” online that can do this for any type of code including html. 

 

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post