Use Code Content Blocks in the Classic Builder
by Intuit• Updated 4 weeks ago
Use the Code content block to add HTML code directly into your email. This block is useful if you want more control of your design than what our other content blocks provide.
In this article, you’ll learn how to use Code content blocks in the classic builder.
Before you start
Here are some things to know before you begin this process.
- This article tells you how to use Code content blocks for the classic builder. For more information on similar content blocks in the new builder, check out our article on Code content blocks.
- Mailchimp’s Support Team isn't trained to troubleshoot custom coding. Contact your developer, or hire a Mailchimp Expert if you need assistance with this advanced feature.
- We recommend that you send test emails or use our Inbox Preview tool to get an idea of how your campaign will look in different email clients.
For more information on each email builder and their content blocks, check out About Mailchimp’s Email Builders.
wistia[id:5k96l2mti4]
Add Code content blocks to your layout
To add a Code content block, follow these steps.
- Click and drag the Code block into your layout.
- In the editing window, type or paste in your code.
- Click Save & Close.
Code block tips
Here are some tips for how to use the Code content block.
- Don't use JavaScript.
Because most email clients block JavaScript to protect against viruses, we automatically remove all detectable JavaScript from your code. - Don't use a word-processing program to create HTML content.
Programs like Microsoft Word or Publisher can add extra styling code that distorts your campaign. We recommend that you write the HTML code in a simple text editor and then paste the code into the Code block. - Use embedded or inline CSS.
In most cases, external CSS files will not work in HTML email. You can add embedded or inline CSS to a Code block, preferably above the body section of your layout. For the best results, we recommend you use inline CSS. - Use media queries to ensure responsive design.
If you want your code to be mobile responsive, you’ll need to include media queries. A media query is a CSS component that allows your content to adapt to different devices. To learn more, check out the W3C Recommendation for Media Queries and the Litmus guide to How to Code a Responsive Email from Scratch. - Use the content studio or absolute paths for images and files.
Use our content studio to host files and images for your campaign. Grab the file URL from the Content Studio and paste it into your code in the Code block. If you host your images on your own server, use absolute paths.
Enable dynamic content
When you design an email, turn any content block into dynamic content that displays different content to recipients based on conditions you set. This helps target different types of contacts at the same time with a single email.
To learn more about dynamic content and how to enable it in your content block, check out About Dynamic Content.
Sign in now for personalized help
See articles customized for your product and join our large community of QuickBooks users.
More like this
- Use RSS Header Content Blocks in the Classic Builderby QuickBooks•Updated 4 weeks ago
- Use Promo Code Content Blocks in the Classic Builderby QuickBooks•Updated 4 weeks ago
- Use Code Content Blocks in the New Builderby QuickBooks•Updated 1 month ago
- About Mailchimp's Email Buildersby QuickBooks•Updated 1 month ago