The Code content block allows you to add HTML code directly into your campaign. Code blocks are the only content blocks that do not include built-in padding. Code blocks are useful if you need more control of your design than what our other content blocks provide.
Unless you're familiar with custom-coding, we do not recommend using the Code block without the help of a developer or one of our experts.
Insert the Code Block
- Navigate to the Design step of the Campaign Builder.
- Click and drag the
Code block into your campaign layout.
- In the editing window, type or paste in your code.
- Click Save & Close.
Code Block Tips
- Don't use a word-processing program to create HTML content.
If you use programs like Microsoft Word or Publisher to generate your HTML content, it can add extra styling code to your campaign, and cause your campaign to look different from what you designed. We recommend that you write the HTML code in a simple text editor and then paste the code into the Code block.
- Embed or use inline CSS.
In most cases, linked CSS files will not work in HTML email. You can add CSS to a Code block, preferably above the body section of your campaign layout. For the best results, use inline CSS in the code you paste into the Code block.
- Use the Content Manager
or absolute paths for images and files.
Use our Content Manager to host files and images for your campaign. Grab the file URL from the Content Manager and paste it into your code in the Code block. If you host your images on your own server, use absolute paths that point back to your server.
- Test your campaign before sending.
Testing is especially important when using custom coding, like in the Code blocks. Send test emails, or use our Inbox Preview tool to get a good idea of how your campaign will look in different email clients.