I want to embed an iframe inside an email that contains the 10 most recent chat messages. Is there a way to make this iframe dynamic so that it always shows the latest 10 chats regardless of when the email is opened? If the iframe is not the correct way to do this, is there a better way?
-
5I recommend to read some results of following search bing.com/search?q=email+beacon to understand what you are trying to do and consider if you want to continue that route. (The answer is NO by the way, but that is not likely what you want to hear, so not really making it as answer)– Alexei LevenkovJan 30, 2016 at 6:52
-
2To emphasize what @AlexeiLevenkov said: many email clients will refuse to render remote content since it might be an email beacon or something worse (which is to say: this is a security concern!). Therefore, the content won't render reliably. If a link is too much to ask, perhaps you should consider an RSS feed or social media (internal or external).– Adam KatzFeb 2, 2016 at 2:35
4 Answers
You can implement an iframe into the email - but your mail will be recognized as spam by many providers.
You should try to render your content dynamically into an image and implement that image into the email.
-
4For the latter purpose, headless crome or Puppeteer are extremely useful.– fuggiNov 19, 2019 at 7:42
-
There kind of is a solution. It is using Dynamic CSS with a fallback of a Dynamic image to pull the information. It is not elegant really as for some clients (e.g. Outlook) this is not available at all and will only display initial information. It also utilizes a link for a style sheet which also severely limits which clients this will work in.
The fall back dynamic image is a bit more comprehensive in client support, but much harder to maintain as you will need to build something that programatically pulls the tweets (HTML webpage potentially) and then also have something that creates and hosts an image for the email to pull. This is not a short, simple thing to set up and may not be worth the required back end work for a simple email.
See this link for a bit more in-depth info on how this can be done for adding a live twitter feed into an email: https://litmus.com/blog/how-to-code-a-live-dynamic-twitter-feed-in-html-email
Since there was no accepted answer i thought i would give my input as well.
Litmus had done something similar for their live twitter feed in emails sometime ago.
The method i can think off is to create a PHP page which takes 10 images and makes it into 1. PHP can have a loop that checks for increments from a specific number and if it exists then add to that 1 image. When there is a new chat image added, PHP will disregard the last one and add the new in the loop.
For anyone reading this in 2022, this is possible with AMP. Instead of an iframe, you can create a dynamic email easily. check out amp.dev
Note: AMP is not supported by many email clients
-
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.– Community BotSep 24, 2022 at 17:36