Using the Code Element for Custom HTML

The Code element lets you paste your own HTML and inline CSS into an email when the standard blocks cannot do what you need. It suits embedded widgets, tracking snippets and one-off layouts.

When to use it

  • Adding a third-party countdown or badge.
  • Placing a tracking pixel.
  • Building a small layout detail the visual editor does not offer.

It is meant for people comfortable with HTML. If you are not, try the other elements first.

Adding a code block

  1. Open Marketing > Emails > Templates and edit or create a template.
  2. Click Add Elements and drag Code into the spot where the snippet should appear.
  3. Click the block to open the Edit tab.
  4. Paste or type your HTML in the code box. Use structure such as tables or divs, and put styling inline.
  5. Click Preview to see the result.
  6. Check desktop and mobile modes.
  7. Send a test email before using it live.

What works and what does not

Inline CSS and plain HTML are generally supported. JavaScript and iframes are blocked by most inboxes for security, so they will not run for most readers.

Keep it self-contained

Write snippets that stand alone. Styles that reach outside the block can disturb neighboring elements. If a block works well, copy or duplicate it into other templates, or save it to Saved Items.

Good to know: Different inbox apps support different parts of HTML and CSS, so test in more than one app before sending to a large list.

Was this article helpful?