Reputation: 443
I'm using Slim
as the templating language for my HTML email. When pretty mode is turned off in production, it puts all the HTML on one line. When the emails go through Sendgrid
, a line break is introduced at the 998th character, breaking the HTML. Sendgrid
does this to comply with the email RFC.
How can I turn pretty mode off while rendering the email, tell Slim
to respect the maximum line length, or introduce a hard line break?
Upvotes: 4
Views: 1185
Reputation: 144
Just add data-force-encoding="✓"
attribute to the body
tag. That will make Rails to send email as quoted printable (trick is to use UTF8 char in fact). See: https://github.com/slim-template/slim/issues/123
Upvotes: 2
Reputation: 443
Adding a few of these
= "\r\n"
throughout the email template solved the problem.
Upvotes: 5