Rebel Insights

Using Mustache Syntax to Customize Mailchimp Templates

Using Mustache Syntax to Customize Mailchimp Templates

RebelMouse has many ways that we can help to simplify your newsletter campaign workflow. Our integration with Mailchimp allows you to automate your daily or weekly newsletter (using an algorithm to select the top-performing posts of either period) or to use our Entry Editor to create a post, which can then be sent to Mailchimp and distributed to your appropriate lists. You are also able to simply select the correct template for any post you send as a newsletter (or your automated newsletters).

Here we will describe how to use the Mustache template syntax with data to render posts in your newsletters. This is a method that we created to make it easy to augment your newsletters by using Mustache templates. You can learn more about the Mustache template here:

To tell an HTML block to render as a Mustache template, we need to create an HTML tag with the "mc:edit" attribute, and have it contain the value "_mustache" as a postfix. For example:

<div mc:edit="posts_list_mustache"></div>

Then, during rendering of the newsletter, the Mustache syntax will be replaced with variables from our posts.

The minimal code needed would be, for example, this code snippet:

<div mc:edit="posts_list_mustache">
  <a href="{{ post_url }}"><img src="{{image600x}}"></a>
   <a href="{{ post_url }}" target="_blank">{{ header }}</a>

List of Variables

For the "posts_list" List:




Header/Headline of a post


Subheader/Subheadline of a post


Post URL


Lead image 600x


Lead image 300x


Lead image 980x


Image (this displays an image and works in Gmail correctly)


Body text before listicle/particle


Body text after listicle/particle


Author names list

author_name0, author_name1, author_name2, author_name{}

Author names


Author avatars list

author_avatar0, author_avatar1, author_avatar2, author_avatar{}

Author avatars


Created date


Is keep reading enabled for the post


Tags list


A list of listicles/particles


A list of related posts

Note: Sometimes you may have multiple authors that you want to attribute a newsletter to. Such as, instead of saying "By Author 1" in the newsletter, you want to say "By Author 1 and Author 2." This simply requires a tweak to the code, as seen below:

<code>{{#author_name1}} //Checking if we have the second author 
By {{ author_name0}} and {{ author_name1 }} 
{{^author_name1}} //If we don't have the second author we print only one 
By {{ author_name0}} 

For the "listicle_items_list" List:




Check if the image is set for a given listicle/particle


Listicle/Particle 600x px image


image (this displays an image and works in Gmail correctly)


Sometimes instead of the lead image, media HTML might be defined


Listicle/Particle headline


Listicle/Particle body


Particle URL


True if the post has brief parameter filled (used to determine Keep Reading)


Brief parameter (used to show the first part of Keep Reading)

For the "listicle_items_by_groups" List:

(In case you are dealing with multicolumn listicles.)




Marks if a given particle is multicolumn


Is this a two-column layout


Is this a three-column layout


Is this a parallax layout


Is this an e-commerce layout


First item of a particle


Second item of a particle


Where {} is a number, it will render information about a given item. So in case we are dealing with a three-column layout, we will have item0, item1 and item2. For a two-layout column, it's item0 and item1. And for single-column layout, only item0 will be available.


A Boolean that determines if slug of particle is starting with sponsored content or a sponsored response. Used to determine if the post is sponsored.


True if the post has a brief parameter filled (used to determine Keep Reading)


Brief parameter (used to show the first part of Keep Reading)

For the Item object for the "listicle_items_by_groups" List:




Item base name


Please refer to the "image choices" section


Is it the first particle


Is it the last particle


Does the particle contain an image


Particle headline


Sometimes instead of the lead image, media HTML might be defined


A URL to a given particle


ID of a particle


Index of a particle


Link to a given particle


Particle body (not parsed)


Particle description (parsed)

Image Choices:




Checks if an image is set for a given listicle/particle


Listicle/Particle 600x px image


Image (this displays an image and works in Gmail correctly)


Same as image


Image 210x


Image 300x


Image 600x


Image 980x


Image 35x35


Image 300x300


Image 600x200


Image 600x300


Image 600x400


Image 600x600


Image 750x1000


Image 700x1245


Image 1000x750


Image 1200x400


Image 1200x600


Image 1200x800


Image 1245x700


Image 1500x2000


Image 2000x1500

Here is an example of a simple HTML template with Mustache syntax used:

Creating a Template in Mailchimp

To create a template in Mailchimp, we need to log in to the Mailchimp dashboard, then go to the Templates view and create a new template:

Then select the "Paste in code" option in the next step:

Now you can copy-paste the sample template from the GitHub link above.

Once that's been entered, you simply click Save and Exit in the bottom-left corner of the screen. Then you'll be prompted for a name for the template. Enter a familiar name for your template that helps keep you organized and you're through this part! You can continue to edit the template to make it fully your own, too.

Testing the Template

To test your template, the easiest way would be to create a new "Audience" or "List" in your Mailchimp dashboard, and then add test emails to your newly created audience.

From our Entry Editor, go to the Send a Newsletter tab and select your newly created audience and test template:

After publishing a post, you should receive a test email that uses the test template. Note that if you have any errors in the code in the template, Mailchimp may not receive the newsletter. If you notice that the draft isn't appearing in your Campaigns tab in Mailchimp when you send to Mailchimp, you'll want to check your code to be sure that there are no errors.

You can repeat this flow by changing something in your template, saving it, and then editing this post in Entry Editor and checking the changes in the emails you will receive.

If you have any questions, please contact your account manager or

What Is RebelMouse?
Request a Proposal
Multivariate Testing: An Introduction to Data-Driven Site Design
Rebel Insights

Multivariate Testing: An Introduction to Data-Driven Site Design

Understand the differences between multivariate testing and A/B tests

The modern digital landscape is founded on one critical element — data. From content creation to site design, there’s no reason to take chances on what will resonate with your audiences. Adopting a data-driven mindset means you can take the guesswork out of your business strategy and focus on the methods that are actually moving the needle.

And one of the best ways to figure out what strategies are moving the needle for your website is through multivariate testing.

What Is Multivariate Testing?

Multivariate testing is the process of testing one or more components on a website in a live environment. These components can be anything from a CTA button, headline formatting, or even an entire page design. The beauty of multivariate testing is that you can test each one of these individual features on a page to see what performs well among your users.

Think about it for a moment. Creative teams with great ideas are most successful when they have an environment where ideas can easily be tested against each other instead of trying to find total agreement on one idea. Multivariate testing allows teams to cherry-pick each idea to create an end result that works best, backed by the data to prove it.

multivariate testing allows for various layout designs and element placements to be tested live to see what attracts the most readershipSee which elements and layout designs attract the most readers with multivariate testing. Graphic from Invesp.

Multivariate Testing vs. A/B Tests

Traditional A/B testing is the process of creating two different layouts and splitting the traffic between the two to see which one performs better. It’s possible to test more than just two layouts, of course, and there’s no issue with creating A/B/C/D/etc. tests depending on how many layouts you have to try.

A/B tests can produce great results, but they are limited since they test an entire layout at once. Remember, multivariate testing allows you to test the different components of a layout individually. Think of multivariate testing as running multiple A/B tests at one time. Here’s a good illustration of the differences between A/B testing and multivariate testing from HubSpot:

A/B testing compares two layouts as a single page, while multivariate testing allows for multiple elements to be tested simultaneouslyAn illustration of the more complex testing available through multivariate testing. From HubSpot.

Multivariate testing is a great way to help creative environments stay focused. However, it’s vital that all ideas get measured, because one idea might sound awesome to the group or a team member, but it may not always perform.

How Do I Know When to Use Multivariate Testing?

If you are looking for fast results, it’s best to use A/B testing. However, multivariate testing is the preferred choice if you have the time to analyze and review multiple data points. Combined, the testing on each one of your site elements will help you curate the highest-performing page possible. It’s also recommended that you use multivariate testing on your pages with the highest traffic because there will be more data to analyze to determine which site elements are garnering the most engagement.

Keep reading...Show less
The Most Secure CMS of 2022

The Most Secure CMS of 2022

Why RebelMouse Is the Most Secure CMS on the Web

Delivering a secure, high-performing environment with extreme reliability is essential to all of our clients at RebelMouse. We only use industry-leading, reliable approaches to host our infrastructure. This ensures maximum stability and security for all of our clients’ data. Here are just some of the reasons we’re able to maintain a hard-bodied product that’s flexible, too.

Keep reading...Show less
Interested in a Free Website Health Check?Check Your
Website's Health
Get Your Free Analysis Now