How to add a dynamic image to a text message

Estimated 3 minute read
|
Updated Feb 4, 2025, 7:06 PM EST
You will learn

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

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 have dynamic images only when the image URL exists as a custom property on the recipient’s profile.

Also, it's important note the following regarding dynamic images: 

  • Only 1 dynamic image is allowed per MMS.
  • Images should be under 600 KB; otherwise carriers will compress it, which may make the image look distorted.
  • 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.
  • 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

How to add a dynamic image

  1. Select the flow message where you want to include your dynamic image.
  2. In the right sidebar, click Edit.Sidebar for a new SMS message in a flow
  3. Click the Preview & text in the upper right corner.
  4. Find the data source for the image you want to include.
  5. Click the data source for an image's first variable, which will typically end in 0.
  6. Click Done
  7. On the left, click the Add image icon (an image icon) in the Message box.
  8. Go to the Dynamic Image tab.
  9. Paste the dynamic variable or dynamic URL for the image.
  10. Click Save.
  11. Check that the dynamic image was added correctly by making sure one appears in the preview screen.
Use catalog tags 

You can also use catalog tags to add dynamic images in the MMS. To do so: 

  1. From the SMS preview modal, locate the product ID or SKU for the first listed product. 
  2. Copy this variable. 
  3. Click Done to return to the SMS editor. 
  4. On the left, click the Add image icon (an image icon) in the message box.
  5. Go to the Dynamic Image tab.
  6. Paste in the following catalog tag:
    {% catalog event.id %} {{catalog_item.featured_image.thumbnail.src}} {% endcatalog %}
  7. Replace event.id in {% catalog event.id %} with the variable from the tag you previously copied. Remove the brackets and any filters from the variable (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 %}
  8. Click Save
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 exact format for these statements depends on your integration, and you should not copy them from email templates.

Additional resources

Additional resources

Was this article helpful?
Use this form only for article feedback. Learn how to contact support.

Explore more from Klaviyo

Community
Connect with peers, partners, and Klaviyo experts to find inspiration, share insights, and get answers to all of your questions.
Live training
Join a live session with Klaviyo experts to learn about best practices, how to set up key features, and more.
Support

Access support through your account.

Email support (free trial and paid accounts) Available 24/7

Chat/virtual assistance
Availability varies by location and plan type