Join us
@ketbostoganashvili ă» Jul 28,2024 ă» 7 min read ă» 173 views ă» Originally posted on mailtrap.io
A developer canât code an HTML email template using the same technologies and approaches as one would when building a web page. It may sound ridiculous, but itâs the truth. So, letâs try to figure out how valid this statement is.
While coding a web page, an engineer takes the following factors into consideration:
When building an HTML email template, in addition to the operating system and screen size, one has to account for the email client.
There is a wide selection of email clients that encompasses several web and desktop solutions, where the way an email is displayed depends largely on the rendering engine a system uses.
Of course, a universal set of standards would be much easier for email clients to support and for developers to comply with. But, unfortunately, we donât have any. Every email client plays by its own rules. Thatâs why the rendering of CSS by various email clients may differ significantly.
In June 2018, Litmus released an Email Client Market Share report which was based on 1.04B email opens data they gathered worldwide. One can review this report to get an idea about the core market players and their shares in this area.
If you are using Sendgrid, go to Stats, and then Email Clients & Devices. Sendgrid will provide you with several respective categories: Top Devices, Top Webmail Clients, and Top Desktop Clients.
According to the Litmus Email Client Market Share report, Outlook ranks #5 with a 7% market share. However, not everyone knows that Outlook for Windows still uses the Microsoft Word engine for rendering. At the same time, Outlook for Mac supports almost any kind of HTML and CSS formatting.
Below are only some of the aspects a developer should bear in mind when adjusting an email template for an Outlook email client:
Of course, some of the above-mentioned cases may be solved by using a âtableâ tag structure in an email template, while others require special tricks and workarounds that engineers may apply to ensure correct email rendering.
There are some aspects that one should consider when building HTML email templates. Letâs review the suggestions below.
We recommend developers keep the email design simple. Apply grid-based layers and stay away from the elements that include positioning or HTML floats.
With Apple iPhone email client ranking #1 in the recent Litmus report, one can see clearly that it is crucial for an email template to display well not only on desktop but also on tablet and smartphone.
To succeed with this task, one can try using scalable, fluid, or responsive design. So, letâs dive a bit deeper into each type of design to choose the one which will suit your requirements best.
This type of design presumes the presence of a minimum number of structural elements in an email. Thatâs why it usually consists of one text column that can be easily scaled for all types of devices, one image, and a Call to Action (CTA) button.
The fluid design uses percentages to adjust to a recipientâs screen size by filling up all space in an email just like fluid would do in an empty container. However, to make sure an emailâs content does not cover all the available screen area, it is recommended to configure the tableâs maximum width. Itâs a common practice to set the default width to 600px.
Utilizing responsive design, in turn, allows sending customized HTML email templates that may automatically adjust not only the size but also the content depending on a recipientâs device and screen size. The desktop and the mobile version of an email may differ significantly from each other or may be alike. In the end, a desktop version of an email may include more or different components than a mobile version and vice versa, which makes this type of design universal for all devices and screen sizes (existing and newly introduced).
Media queries, introduced in CSS3, empower responsive design. The top email clients are well aware of what media queries are. However, itâs worth keeping in mind that there are still email clients that wonât succeed with their rendering at all.
Working with HTML email design, one should remember the golden rule â mobile design goes first. I.e., a mobile version should be checked first to decrease the loading time on small devices. For instance, the first condition may be set as âlarger than 768 pixelsâ.
Many email clients wonât be able to render Google Fonts properly. In this case, one should opt for the common fonts that the major email clients interpret well. Such as Times New Roman, Arial, Georgia, and Verdana.
Some email clients block images by default and some users may amend their inbox settings to block images if the client isnât doing it. So, it is best to follow the advice below when coding an email template:
Last but not least: keep in mind the email size. The maximum file size limits for emails are pretty high, but the recommended size of the email body should not exceed 250KB.
For more development tips and code samples, check our guide on building HTML Email.
Otherwise, you can try using an HTML email builder. They usually come with a set of customizable email templates, which can be used in any email sending system. In this post, we have reviewed the ten tools suitable for both developersâ and marketersâ needs.
Before sending out an HTML email campaign, it is worth checking whether your emails will get delivered to recipients or end up marked as spam, as well as getting some email rendering advice.
For this, we recommend using a solution such as Mailtrap Email Sandbox, which provides you with a safe environment for inspecting and debugging testing emails, so you donât accidentally end up spamming recipients.
Mailtrap Email Sandbox comes in especially handy for testing HTML emails as it provides a range of features intended specifically for this purpose. So, once you send your first test email to Mailtrap Email Sandbox (process described in detail here), you will be able to:
Other features of Mailtrap Email Sandbox include multiple virtual inboxes for different projects and project stages, blacklist reports for your sender IP/domain, spam analysis, manual and automatic email forwarding to whitelisted recipients, and insight into detailed tech info â essentially everything one needs for advanced email testing.
To get started with this solution, all you need to do is sign up for a free Mailtrap account and complete a 5-minute setup. After that, you can start exploring all the mentioned Email Sandbox features.
We hope that this blog post addressed some of the core aspects you should be paying attention to when crafting an email template. In addition, we just wanted to remind you one more time how important HTML emails testing is đ
We appreciate you chose this article to know how to build HTML email template. To read more article on related topics, follow Mailtrap blog!
Join other developers and claim your FAUN account now!
Technical Content Writer
@ketbostoganashviliInfluence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.