How to Add a Dynamic Image to a Text Message

Last updated at:


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.

This article explains how to add a dynamic image to a text message.

What to Know

Dynamic images that are based on event data (e.g., items from a checkout or placed order) are available for messages in metric-triggered flows. You can also use dynamic images in campaigns and list- and segment-triggered flows. However, because there is no event data to reference for these messages, the image URL must exist as a custom property on the recipient’s profile. 

You can only use one dynamic MMS image per message. Due to this, do not copy the event variable tag from any default email message, as those are set to populate all images in an array and thus can show multiple images, which doesn’t work for an SMS.

If you add a dynamic image tag to an SMS, it will automatically be converted into an MMS. Thus, if you add a dynamic image, it will count as three sends under the SMS billing plan.

For the best results, images should be under 600 KB in any MMS message. If they are more than 600 KB, wireless carriers may compress the image, making it appear distorted to recipients.

You can use conditional statements for dynamic images. For example, you can create an if/else statement to say that if there's a variant image, show that to recipients; else, use the default image (e.g., {% 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.

How to Add a Dynamic Image

  1. Select the flow message where you want to include your dynamic image
  2. In the left sidebar, click Configure Content or Edit
  3. Click the View details button in the upper right-hand corner of the Previewing tab
  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. On the left, click Add Media in the Message box
  7. Go to the Dynamic Image tab
  8. Paste the dynamic variable or dynamic URL for the image
  9. Click Save 
  10. Check that the dynamic image was added correctly by making sure one appears in the preview screen

Additional Resources

Find more MMS Image and GIF best practices

Learn more about event variables in Klaviyo:


Was this article helpful?
19 out of 30 found this helpful