Guide to Using Unique Coupon Codes in SMS and MMS Messages

Last updated at:


Unique, also called dynamic, coupon codes are available for SMS/MMS messages. This makes it simple to send one-time-use coupons to those opted into SMS marketing from your business. In this article, learn how to add unique coupon codes to text messages in Klaviyo.

You cannot use unique coupon codes for the autoresponder message under Account > Settings > SMS.

Add Coupon Codes to Klaviyo

The process for creating a unique coupon code for SMS is the same as for email. Klaviyo can generate these codes for Shopify, Magento 1, and Magento 2


For all other ecommerce integrations, including BigCommerce and WooCommerce, you can generate the coupons outside of Klaviyo and then upload the coupon codes to your account.


Send an SMS Campaign with a Coupon

Once you have coupons generated or uploaded to Klaviyo, you can start including coupons in SMS or MMS campaigns sent to your subscribers. Only one coupon code can be added to a single SMS message.

Navigate to Campaigns, and click Create Campaign. Select SMS, name the campaign, and then choose your recipients.

Build out your message in the Content screen. To add the coupon code, include the following template tag. Remember to change "CouponName" to the name of your coupon:

{% coupon_code 'CouponName' %}

The coupon will appear differently when sent to a subscriber than in the preview window. Displaying an actual coupon within preview would use one of your coupon codes. To avoid this, you’ll instead see the name of the coupon code followed by “-PREVIEW.”

The example below shows how the preview will appear for a coupon named “SummerSale”.


After configuring the content, click Save & Continue to Review. Klaviyo will check that the coupon has enough codes for the recipients, and you won’t be able to send until you have enough for all of your recipients. It is a best practice to add more coupon codes than you need in case you’re scheduling the campaign to send later and more people join the list or segment you’re sending to.


Once you’ve confirmed you have enough coupon codes, schedule the SMS campaign or send it immediately.

Use Coupon Codes in SMS Flows

Flow messages that use the same coupon will send the same coupon code to a recipient. For instance, if an SMS and an email include the same 20% off coupon, the coupon code will be the same. 

To add a coupon code to an SMS message in a flow, first navigate to the specific flow and message where you want the coupon. Next, add the following snippet to the message, replacing CouponName with the name of your coupon:

{% coupon_code 'CouponName' %}


It’s extremely important that you have enough coupons available for flows. Unlike campaigns, there isn’t a review stage where you can check that you have enough. Flows will automatically send as people qualify for them, so you want to verify that there are plenty of coupons available.

For Shopify, Magento 1, and Magento 2, Klaviyo will automatically generate 100 codes if the number of coupon codes ever drops below 100. However, for other integrations, you have to manually upload new codes; thus, we recommend routinely checking on the number of coupons available.

Error Messages

There are three types of errors you can receive when using coupons in SMS messages. These errors will display for both campaigns and flows on the left-hand side of your screen.

The first error is that Klaviyo cannot find the coupon code matching the coupon name. For instance, if the name is missing a number, spelled incorrectly, etc. In this case, check that the name you inputted is the same as the one in Coupons.


The second type of error is that the template tag is formatted incorrectly. For example, if it has extra spaces or missing brackets. Make sure that the tag is formatted as:

{% coupon_code 'CouponName' %}


You will also receive an error if you have multiple coupons in a single text. Only one coupon is allowed per SMS, so check that you haven’t used two different ones by accident.


Best Practices

There are several best practices for using unique coupon codes for SMS and MMS messages:

  • Add more codes than strictly needed; having 50 extra coupon codes is recommended.
  • Upload or generate coupon codes in advance; this process takes time, especially for a large number of codes, so it is best to do it a day or two before you start sending.
  • If you upload your coupon codes and use them in a flow, check that you have a buffer of 50 codes on a routine basis.
  • Use separate coupon codes for each campaign and flow. Having a different coupon code for each of your sends makes it easier to generate/upload the right number of codes as well as track where people saw the coupons.

Additional Resources

Was this article helpful?
47 out of 71 found this helpful