With the Custom HTML block in Omnisend’s Email Builder, you can go beyond standard design tools and add your own code. Whether you need to embed third-party widgets, add custom styling, or insert advanced content elements, this block gives you the flexibility to fully customize your email layout.
Before You Begin
Using the HTML block may require a working knowledge of HTML and inline CSS to ensure your content displays correctly.
Some elements, such as <iframe>, are not supported. You’ll find a list of supported tags, attributes, and CSS below.
Always test your email by sending it to yourself before launching your campaign or automation, as rendering can vary across email clients like Gmail, Outlook, and Apple Mail.
Add an HTML Item
Like any Omnisend Email Builder Item, you can drag and drop an HTML block to your email builder.
The HTML block allows you to add custom HTML code, such as countdown timers. Since this feature may need some advanced knowledge, make sure to use executable HTML and always send a test campaign before sending it to your customers.
💬 Learn more about the Basics of Email HTML.
Allowed HTML Tags and Supported CSS Elements
To ensure your emails look great and are compatible with major email clients, the HTML block in Omnisend supports only a limited set of HTML tags, attributes, and CSS styles. Below is a complete list of the supported elements you can use to enhance your emails.
CSS Background Properties
CSS Box and Border Properties
CSS Media Queries
CSS Text Properties
CSS Table Properties
HTML
Link Element
Style Element
HTML Tags
Note! The HTML item supports only the <body> part of the email, and the <head> should be left out.
Use Cases
Countdown Timers in the Email Campaigns
If you wish to have a timer in your campaign, you can add it by using the HTML item:
Drag and drop the HTML item to the template
Go to https://www.sendtric.com and create a countdown timer. Remember that this service requires a subscription to a paid plan to turn on a countdown timer.
Click generate and copy the code.
Paste the code into the HTML block in Omnisend and click Save
To have it centered, use the following settings:
find style=" display: block;"
replace with style="display: block; margin-left: auto; margin-right: auto; width: 50%"
If you'd like to generate the countdown time based on when the email is sent, you need to add [[ current_date | date: "%s" | plus: 86400 ]]. This function takes the current date/time > converts it to seconds, -> additionally adds 86400 seconds (1 day) to the current timing. The final centric example should look like this example:
<img src="http://gen.sendtric.com/countdown/vtkfdyi20u?to=[[ current_date | date: '%s' | plus: 86400]]" style="display: block;" />
You can change the number of seconds to any number you like; for example, 86400 seconds = 1 day.
💡 Several alternatives offer countdown timers. For example, you may try NiftyImages as it allows you to generate a dynamic timer for free. You can also try our third-party integration, Essential Email Countdown Timer.
Countdown Timers in the Automation Email
For automations, you need a dynamic timer to function properly whenever the email is sent to a user. Please be aware that the app mentioned above, Sendtric, only allows building dynamic timers on paid plans. It's up to you to decide if you want to use it or use other alternatives.
However, we have found a free option for you, and you can do that on a free plan with NiftyImages.
First, you'll need to create a free account and timer. In the editor, you'll see a hyperlink called "Want to use the dynamic date" → this will give you instructions on accessing the Dynamic timers guide.
Note! To make the countdown timer dynamic, check the 'Email merge tag' checkbox.
💬 We recommend watching NiftyImages Video guide to familiarize yourself with dynamic timers and how they work.
Let's add our timer based on a specific use case: imagine you want a dynamic timer that expires at the end of the sale (using a discount item).
Step 1. Create your automation in Omnisend → Open Email Builder and add a discount block for your sale. Set the expiration date for your discount, which will be the same as the expiration date for your timer.
Important! In Shopify, the discount code expires at 12:00 AM on the date you select in Omnisend. So you need to adjust the countdown timer to match that expiration date.
Step 2. Add an HTML code here with a countdown timer showing when the discount code expires. Copy the Year-Month-Day and Timezone Offset HTML from Nifty images and add it to the HTML Item in Omnisend.
Now you need to change the date format to the Omnisend date format. Find the date in your code. You will see there is a dash between each personalization tag, which you will replace with Omnisend dynamic date tags.
Remove the date part from the code and insert Omnisend personalization tags:[[current_date | date:'%Y']]-[[current_date | date:'%m']]-[[current_date | date:'%d']]
.
Once replaced, the date will show zeros, but when the email is sent out, an actual date will be shown here because we added personalization tags.
Step 3. Adjust the timezone. In personalization, you will see a time zone set to Greenwich time. You need to change it to the timezone of your account. As shown in the screenshot below, change "T00:00:00-07" to "T00:00:00+2," etc., based on your timezone.
Step 4. Your timer is set to today's date, but you also want it to count dynamically till the end of your sale (discount expiry is set to 2 days).
For example, if your discount code expires in 2 days, you need your timer to run dynamically for 72 (it doesn't count today, so you need to add 24h to 2 days).
For this, go to Niftyimages, copy this code, return to the HTML item in Omnisend, and place it right after the format tag. Please note that the number of hours should be adjusted based on your sales duration. If your discount expires in 10 days, you must put 264 (240h+24h).
Here's an example of code pasted in Omnisend:
That's it; you've set the timer to run till the end of your promotion. Please remember that you can only test automation by triggering it yourself.
Troubleshooting
If you’re confident in your coding skills or have a developer to assist you, you can create custom HTML elements using this block. However, we don’t recommend using the HTML item without thorough testing, as it requires advanced knowledge of HTML and CSS.
Please note that the Omnisend Support Team cannot assist with issues related to custom code. If your custom element doesn’t display as expected, we recommend reaching out to the provider of the specific code snippet for assistance.
Any general questions? Feel free to reach out to our support team. We're available via in-app chat and at [email protected].