Mailcoach can send beautiful newsletters to your audience. In this blog post, I'd like to explain how we ensure that the CSS of our webpage does not break the layout of your newsletter.

Notice that the web-view Blade component receives the $webview variable, which contains the entire HTML contents of a sent newsletter.

And finally, we're setting the HTML of the shadow DOM to the HTML of the newsletter (contained in $html).

Using the shadow DOM, we can ensure that the sent newsletter we display is not affected by the layout of our website.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners