Skip to main content

Personalised images in Mailchimp

Use OKZest with Mailchimp to show each subscriber an image with their own details, such as their first name. Mailchimp swaps its merge tags for each subscriber's data when it sends, and OKZest builds the image from that data.

You need: an OKZest account with a saved design that has at least one dynamic text layer, and a Mailchimp account with an audience that holds the details you want to show.

1. Use Mailchimp's merge tag in your design​

A merge tag is a placeholder that Mailchimp replaces with a subscriber's details. Mailchimp writes them between *| and |*. The common ones are:

DetailMailchimp merge tag
First name*|FNAME|*
Last name*|LNAME|*
Email address*|EMAIL|*

These come from Mailchimp's merge tag cheat sheet. The tag only shows a value when the subscriber has that detail on their contact record, so set a default text in OKZest for everyone else.

In OKZest:

  1. Open your design and select the dynamic text layer.
  2. In Text settings, enter a short ID, such as first_name.
  3. In Merge tag, enter *|FNAME|*.
  4. Enter Default text, such as friend, then save the design.

See Merge tags for the full list of formats and the rules for other layer types. If you have not made a design yet, follow the email quickstart first.

2. Copy the image code from OKZest​

  1. In OKZest, select Share.
  2. Under Embed your image, select Copy <img>.
  3. If a yellow Some merge tags are missing box appears, type *|FNAME|* into it and select Save changes, then copy the code again.

The image address in the code looks like this, where first_name is your layer ID:

https://media.okzest.com/img?c=YOUR_COMPANY_ID&i=YOUR_DESIGN_ID&first_name=*|FNAME|*

3. Paste it into a Mailchimp Code block​

Mailchimp accepts custom HTML in a Code content block, which is available in the new builder. Mailchimp describes the Code block as an advanced feature and removes any JavaScript, which is fine here because the image code is plain HTML.

  1. In Mailchimp, create or edit your campaign and open the email designer.
  2. Click a Code block, or drag one from the side panel into your layout.
  3. In the Code menu, delete any placeholder code.
  4. Paste the <img> code you copied from OKZest.
  5. Save the block and the campaign.

Source: Mailchimp: Use Code Content Blocks in the New Builder.

Keep the merge tag in the address

Paste the whole <img> tag into the Code block so the merge tag stays in the image address. Mailchimp then replaces it for each subscriber when it sends.

4. Send a test​

Use a preview or a test send to see the merge tag replaced, rather than judging the image from the editor.

  1. In the campaign, open the Preview menu and choose Enter preview mode, or send a test email to yourself.
  2. Check that the image shows your own details.
  3. If your own record has no first name, you will see the default text. Add a first name to your contact and send again to check the personal version.

If it does not work​

  • The image shows the default text for everyone. The merge tag may be mistyped, or the subscriber has no value for that field. Check the tag in OKZest matches Mailchimp exactly, including capitals.
  • A broken image appears. Paste the image address into a browser, replacing the merge tag with a real name such as first_name=Sam. If it loads, the design is fine and the problem is in how the code was pasted.
  • Names with unusual characters look wrong. See Merge tags for how OKZest encodes values, and the troubleshooting page.

What next​