Cerberus icon indicating copy to clipboard operation
Cerberus copied to clipboard

Improve email forwarding

Open TedGoas opened this issue 4 years ago • 4 comments
trafficstars

This PR attempts to improve Cerberus's rendering in Gmail after it's forwarded. #264 and #262 both report issues with the templates' rendering when forwarded. @maxackerman pointed out this nifty trick by Lee Munroe that prevents ESPs from inlining certain CSS properties, which seems to be the cause of the email breakage when forwarding.

I haven't fully tested this in Gmail, but adding it doesn't seem to cause any regression.

@maxackerman @marcelgruber would you be willing to help test this?

TedGoas avatar Jun 02 '21 11:06 TedGoas

yep! i’ll take a look see how it plays out in my workflow.

maxackerman avatar Jun 07 '21 00:06 maxackerman

I will aim to take a look this week

marcelgruber avatar Jun 07 '21 13:06 marcelgruber

Why aren't all of the styles wrapped in @media all?

I sent the raw HTML (hybrid template) to my gmail, and it worked as expected. However, once I forwarded from gmail to EoA, the entire <head> got stripped.

I did the same test by sending the raw email to Outlook online, and then forwarding to EoA. The entire <head> got stripped and there were also visible layout issues.

I believe the only real solution here is to inline all of the styles. We could add info to the README about that. For the sake of this repo, I can see why it makes sense to neatly organize many of the styles in the <head>, but when it comes time to actually send the email, the template should be run through some kind of an automatic style inliner.

marcelgruber avatar Jun 11 '21 20:06 marcelgruber

I'd like to avoid requiring an inline for email forwarding. Not everyone has access to an inliner (eg. emails coming from a codebase rather than an ESP) and requiring an inliner introduces a dependency, which goes against my core values for Cerberus.

Would wrapping all the styles in a @media all do the trick? Or are there certain styles we can focus on?

TedGoas avatar Jun 27 '21 15:06 TedGoas