---
title: "Dynamic images, MailKaro Docs"
description: "Dynamic images in MailKaro: swap an image per recipient by putting a tag in its URL. For React, Vue, Angular and plain JavaScript."
---

# Dynamic images

Personalization

# Dynamic images

Swap an image per recipient by putting a tag in its URL.

An image block's `src` can contain a [merge tag](https://docs.mailkaro.com/merge-tags) or [design tag](https://docs.mailkaro.com/design-tags), it's resolved at render like any other field:

json

```
{ "type": "image", "values": { "src": "https://cdn/badge/{{tier}}.png" } }
```

Rendered with `mergeTags: { tier: "gold" }` the image points at the gold badge. Works in carousel slides too.

## Where tags work

Tags are filled in an image's `src`, `alt` and link `href`, and in each carousel slide. A whole URL can be one tag, such as `{{avatar_url}}`, or a tag can start the URL with a path after it, such as `{{cdn}}/badges/gold.png`.

## Exporting without data

When you export with no merge data, an unknown tag is left as written, so your sending platform can fill it in for each recipient. Tags in Mailchimp (`*|TAG|*`) and Salesforce (`%%tag%%`) style at the start of a URL are kept too. To fill them on your server, pass the values:

bash

```
POST /v3/render # no key needed
{ "design": { ... }, "merge_tags": { "tier": "gold" } }
```

## Safety check

After the tags are filled, the URL must still start with a safe scheme such as `https:`, or be a `data:image/` URL. If a value turns it into something else, such as `javascript:`, the image is written with an empty `src`.

Source: https://docs.mailkaro.com/dynamic-images
