How to add a dynamic image to a text message
You will learn
Learn how to add a dynamic image to an MMS message in Klaviyo.
Including a dynamic image allows you to personalize your text messages. For instance, you can show someone the exact product they viewed, started a checkout with, or bought.
Before you begin
Depending on your use case, you may not always be able to add a dynamic image.
- Only metric-triggered flows can use dynamic images based on event data (e.g., items from a checkout or placed order) or on catalog tags for an event.
- Campaigns and list- and segment-triggered flows can use image URLs stored as custom profile properties. They can also use catalog tags to look up an image from an item ID stored on the recipient’s profile.
Also, note the following about dynamic images:
- Only 1 dynamic image is allowed per MMS.
- Images should be under 600 KB. Larger images may be compressed by carriers, which can distort them, or fail to deliver.
- If you try to send a dynamic image with a sending number that doesn't allow for MMS, the message will send, but the image will be removed.
- If a dynamic image resolves to an empty or invalid URL, a message with text and no other attachment sends as SMS without the image. This fallback does not apply to previews, test sends, or messages using translations; those require a valid image URL.
- You can use conditional statements with dynamic images.
- Mobile carriers don't support WebP files, and attaching this type of image may cause the message to fail.
How to add a dynamic image
The steps below start from a flow message. For a draft campaign, open its text message editor and skip the first 2 steps.
- Select the flow message where you want to include your dynamic image.
- Next to Content, click Edit.

- If your editor shows RCS options, select SMS fallback. To edit its image separately, open Content and turn off Use the same content from RCS message.
- Click Preview in the upper right corner.

- Choose a preview event or profile that contains the image URL, then expand All properties.
- Click the image URL property to copy its variable. For a list of products or images,
0identifies the first item and can appear in the middle of the variable.

- Click Done.
- In the Content panel, turn on Attachment and select Image (or Media if shown).
- Click Select image (or Select media). If an image is already attached, click Replace.

- Go to the Dynamic image tab.
- Paste the dynamic variable or dynamic URL for the image.

- Click Save.
- Click Preview and check that the expected image appears for the selected event or profile in a region that supports MMS.
- Click Done, then Next to save the message and leave the editor.
Use catalog tags
You can also use catalog tags to add dynamic images in the MMS. To do so:
- In Preview, expand All properties and find the first product’s item ID in the event data. Use the identifier that matches the item in your Klaviyo catalog (a product ID or SKU, depending on the integration). For a profile-based image, find the custom profile property containing the item ID instead.
- Copy this variable.

- Click Done to return to the SMS editor.
- In the Content panel, turn on Attachment and select Image (or Media if shown).
- Click Select image (or Select media). If an image is already attached, click Replace.

- Go to the Dynamic image tab.
- Paste in the following catalog tag:
{% catalog event.id %} {{catalog_item.featured_image.thumbnail.src}} {% endcatalog %} - Replace event.id in {% catalog event.id %} with the variable from the tag you previously copied. Remove the outer brackets and the default filter, but keep any lookup filters needed to access the property (so {{ event.extra.line_items.0.product_id|default:'' }} becomes event.extra.line_items.0.product_id).
Example: {% catalog event.extra.line_items.0.product_id %} {{catalog_item.featured_image.thumbnail.src}} {% endcatalog %} - Click Save.
- Click Preview and check the image using an event or profile with the matching catalog item ID in a region that supports MMS. Click Done, then Next to save the message and leave the editor.
Example of using conditional statements
Dynamic images can use conditional statements.
Below is an example of an if/else statement to say that if there's a variant image, show that to recipients; else, use the default image:
{% if event.extra.line_items.0.product.variant.images.0.src %}{{ event.extra.line_items.0.product.variant.images.0.src }}{% else %}{{ event.extra.line_items.0.product.images.0.src }}{% endif %}
Note that the exact format for these statements depends on your integration, and you should not copy them from email templates.
Additional resources
- Understanding MMS image and GIF best practices
Learn best practices for sending images and GIFs in text messages so that they display nicely to recipients.
- How to use event data to personalize email and SMS flows
Learn what dynamic event data is, when to use it, where to find it, and how to include it in your flow messages. Learn about the different actions your customers take, and how you can use that data for creating personalized messaging flows in Klaviyo. For instance, you could use event data in an abandoned cart flow message to show individuals what product they left behind, an image of the item, and more. This allows for a more personalized experience for the customer, as well as a higher chance of conversion.