8th May 2024

How to code for Mailchimp – using Mailchimp’s template language

Once you have your HTML coded, adding it to Mailchimp so its editable is quite straightforward, our HTML email developers usually do it using one of two options

Option 1 – a fixed Mailchimp template

This method would keep the email design/layout the same, but allow the client to edit the text and images.

As an example, if this is the email:

To make it editable in Mailchimp we would simply:

  1. Ensure an it includes an unsubscribe tag (*|UNSUB|*) as Mailchimp requires this, if not Mailchimp will auto add a footer with this included.
  2. Add in MailChimp’s template language (mc:edit=”unique_name”) on all the elements we want editable.

So see the revised code here:

Option 2 – a Mailchimp email builder

This method would allow the client to essentially build their email out using the blocks you have coded, so if you have 3 blocks on your email – this option would allow the client to add these 3 blocks in, duplicate them, reorder etc.

The method is the same as the above fixed example, however we now also:

  1. Use these tags on the section wrappers: mc:repeatable=”repeater-name” mc:variant=”variant-name” – we keep the repeatable name the same for all the blocks as this tells Mailchimp they are part of the same builder, then we change the variant name for each block so the client knows which block is which i.e. Text Block, Image Block, News Block etc
  2. We can also use mc:hideable to allow the client to hide sections if they require.

So an example of this code is:

To then get the email in Mailchimp zip up your HTML package and simple import in the Template section.

If you images are included in the package, Mailchimp will also include and host these on Mailchimp for you.

Any questions please ask – or see here for more information on Mailchimp’s template language, also if you need any help with a Mailchimp template don’t hesitate to contact us 😊