Using custom code in campaigns

EmailOctopus gives you options to add your HTML code to your campaigns.

Whether you create a campaign or a template in EmailOctopus, you can choose to use our Drag & drop editor, which has the option to insert a custom HTML block, or Code your own editor, which allows you to write or paste the whole code of your email.

In Code your own editor, you can write or paste your code on the left side of the editor. In the right panel, you can preview what your code will look like:

Please remember to include all of our required merge tags in your code.


If you prefer to use our Drag & drop editor, you can add the Code element. It allows you to insert custom HTML in a selected area inside a content row:

Both tools work the same way when it comes to accepting your custom HTML code. However, the code block inside the Drag & drop editor should be used to add custom elements to your template design instead of pasting the whole campaign, as it can clash with the HTML styling of the editor. If you would like to paste the code for the entire campaign, we'd recommend using the Code your own editor.

What custom code can I add to EmailOctopus campaigns and templates?

It's important to remember that HTML support can vary significantly between various email clients. For example, Outlook uses Microsoft Word to render emails, which could lead to some inconsistencies compared to your original design. We recommend testing your campaigns across multiple email clients.

Since there is no single email design standard that would work the same across all the available email clients, it's recommended to keep your design simple. Here are some best practices for HTML in email:

  • The base layout should use static, nested HTML tables – <div> layering doesn't work in email.
  • CSS should be kept inline and simple, as embedded CSS is not widely supported in email.
  • In the case of fonts, it's safest to stick with web-safe fonts or use them as fallbacks. You can use custom fonts only in the Code your own editor.
  • For the best viewing experience on mobile and inside email preview windows, try to keep your templates 600 px wide.
  • When using background images, keep in mind that not all email clients support them. You can verify which ones do in this article.
  • Do not use JavaScript, forms, iframes and embedded videos, as they are not supported in the vast majority of email clients.
  • We don't recommend using anchor links either, as many email clients don't support them at this point.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact us Contact us