Hey all, I am about to throw in the towel with regards to my issue but am hoping for any advice or suggestions before doing so .
Backstory
I use HTML to embed and format YouTube videos, SoundCloud audio clips, images/gifs for my audio blogâs articles and newsletters. The videos and audio clips are often embedded via <iframe>. I have found this allows for more flexible formatting like word wrapping and easy orientation and sizing in-line with text. I am not sure of other/potentially better options.
The Issue
Mailgun strips out a lot of this content, including images hosted on the site and embedded using <figure> which results in oddly formatted emails with missing content. The emails often look like a mess.
Mailgunâs response
I submitted a ticket to Mailgun about this and they told me to refer to âSending Inline Imagesâ in the provided documentation: this link - (image attached below). I am relatively new to webdev and so it could be that I just donât understand what I should be doing. I feel that this response doesnât really resolve my issue, and that I have hit a dead end with Mailgun support.
Seeking Suggestions & Question
-
I read that many email clients refuse remote content (especially when embedded via iframe) because it can be a safety concernâŚ? This makes me feel as though I should accept that my newsletters will have shoddy formatting and just tell my e-mail readers to âclick this link and read from the websiteâ. I would like to adhere to some kind of Newsletter âbest practiceâ, but not sure where to go from here.
-
Does anyone have an idea for how I can include this kind of content and formatting in my newsletters which go out via Mailgun?
Hey @AmbientArtstyles,
Iâm not sure if Mailgun should have been your first place to ask for help on this one. If youâre using Ghost to generate the outbound emails, youâre rather dependent on what Ghost is sending over to Mailgun. If youâre going to have Ghost send your emails, youâre limited by what Ghost does. While you /can/ include HTML in an HTML card, HTML for email is not the same as HTML for websites.
Having said that, yes, iframes and embeds generally donât work well in email. Mail clients donât run javascript, they donât reliably load iframes, or even images. They donât even load CSS or fonts, most of the time. Theyâre also about two decades behind where browsers are, in terms of standards compliance. (Sending a well-formatted email means converting everything into tables and inlining all the styles. Seriously.) Thereâs a reason pretty much every piece of bulk email I receive starts with a âView this email in your browserâ link â email is tough.
A workaround for embeds and javascript not working is to make a âtitle screenâ image for your video, and superimpose what looks like a play button. Link the image to the source (i.e. YouTube), or to your post. No guarantee the image will get loaded in the email client, but odds are much higher than an embedded player. Itâll look right, and clicking will result in (~approximately~) the expected behavior. Another option is to just link the media or post. Introduce the media, then provide a âclick here to see itâ type link.
If I were committed to having users see the preview card for each piece of media, Iâd make those âfakeâ previews, hit âpublish and sendâ, then edit the post to include the actual embeds I wanted on the website version. Or you could create the post, then use the duplicate button in the admin panel to create a copy, that you could edit and email.
2 Likes
Thank you soooooo much for this information! I follow what youâre saying and hugely appreciate the response. This gives me some to think on. I will likely just try to push the âview this email in your browserâ option. Thanks again!
1 Like