Basically, I want to visualize an HTML/CSS email template on various email clients. I'm wondering if it's possible to build some visuals (before sending an email).
Asked
Active
Viewed 59 times
0
-
2It's not uncommon to render charts or other complex items intended to be sent in an email down to an image, if that's what you're talking about. If you're trying to see how a template will look in different email clients, https://www.litmus.com/ is probably the sort of thing you need. – ceejayoz Sep 16 '21 at 20:28
-
Hey, thanks for the quick reply. I want to integrate some sort of live preview of the email template will look in various email clients. I'm not particularly looking for a solution myself. – Zafar Kamal Sep 16 '21 at 20:29
-
Does this answer your question? [Convert HTML to Image in PHP without shell](https://stackoverflow.com/questions/13039627/convert-html-to-image-in-php-without-shell) – stui Sep 16 '21 at 20:33
-
I want to convert the HTML to an image, but with respect to how it looks in Gmail. For example, suppose I have some HTML template and I want to visualize how it will look in the Gmail client (when sent). – Zafar Kamal Sep 16 '21 at 20:37
-
1@SunnyKhan You'd have to actually send it to Gmail, then screenshot Gmail. Not an easy task; you're much better off using the Litmus API or a similar offering. https://docs.litmus.com/docs/instant-api – ceejayoz Sep 16 '21 at 20:39
-
The main issue is, I don't want my plugin users to rely on these services. – Zafar Kamal Sep 16 '21 at 20:40
-
Is it possible to mimic what an HTML would look like on a certain email client without actually sending the email? – Zafar Kamal Sep 16 '21 at 20:40
-
You could put your own email address into the script, sent it, and then open it in whatever client you want to test with. – user3783243 Sep 16 '21 at 20:41
-
I could do that, but how do I show the preview to the user. Also, it would be something much costly i suppose? – Zafar Kamal Sep 16 '21 at 20:42
-
1The appearance of an email layout can change dramatically across providers and devices. It would be very difficult to develop on your own a program capable of previewing even the most popular scenarios only. You should rely on some 3rd-party API for this. – Felipe Saldanha Sep 16 '21 at 22:21
1 Answers
2
You'll need to use an API like some of the commenters have said.
You can try Litmus API, https://docs.litmus.com/v1/docs Email on Acid API, https://api.emailonacid.com/docs/latest And possibly others such as https://emailpreviewservices.com/features/white-label-api
You send the HTML, and it sends back screenshots from real devices.

Nathan
- 4,358
- 2
- 10
- 26