Loading
Mobile Studio in Marketing Cloud Engagement
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Offer a Limited Number of Coupon Codes in MobileConnect

          Offer a Limited Number of Coupon Codes in MobileConnect

          You can dynamically assign coupon codes using AMPscript and a data extension in Marketing Cloud Engagement.

          For example, Northern Trail Outfitters wants to distribute a limited number of coupon codes to customers, so they create a text response message tied to a data extension via AMPscript. When customers send a message to the text response keyword, they receive a coupon code from the data extension. When the coupon codes are sent out, the customer receives a message thanking them for their response and explaining that Northern Trail Outfitters sent out all available codes.

          1. Create a .csv file that contains the coupon codes.
          2. Create a data extension that contains these required columns:
            • IsClaimed—A Boolean value that indicates whether the code is claimed or unclaimed. 0 is false, unclaimed. 1 is true, claimed.
            • CouponCode—A string value that contains the coupon code
            • SubscriberKey—A string value that contains the subscriber key or contact key for the customer who claims the code
          3. Import your data from the .csv file into the data extension.
          4. Create a text response message. Include the following AMPscript in the response message. ClaimRowDE is the external key for the example data extension.
            %%[VAR @CouponRow SET @CouponRow = ClaimRow("ClaimRowDE", "IsClaimed", "SubscriberKey", 
            MOBILE_NUMBER) IF EMPTY(@CouponRow) THEN ]%%Sorry - No coupons available.%%[ ELSE ]%%Congrats! 
            Your promo code is %%=FIELD(@CouponRow,"CouponCode")=%% and expires in 3 days. Thanks for Responding! 
            %%[ENDIF]%%
          5. Schedule or send the text response message.
           
          Loading
          Salesforce Help | Article