Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve email forwarding #265

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Improve email forwarding #265

wants to merge 2 commits into from

Conversation

TedGoas
Copy link
Collaborator

@TedGoas TedGoas commented Jun 2, 2021

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 TedGoas added the bug something in the original template doesn't display correctly label Jun 2, 2021
@maxackerman
Copy link

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

@marcelgruber
Copy link

I will aim to take a look this week

@marcelgruber
Copy link

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.

@TedGoas
Copy link
Collaborator Author

TedGoas commented Jun 27, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something in the original template doesn't display correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants