Here is the requirement - A customer purchases 2 assets, we should be sending two different coupon codes to the same subscriber.
Based on the requirement, we have changed the code (Query) to assign multiple coupons to a Subscriber based on the Asset (ID).
we are using live coupons in the email. During the send time, it is picking only one(Same) Coupon code in both the emails.
with this, duplicate coupon codes are sent to customer though different coupon codes are assigned in the CouponCodes Data Extension.
Ideally it should be picking different coupons assigned to the same subscriber from the coupon code DataExtension.
We are trying to use claimrow() functionality to achieve this. claimed row returns a row that is claimed.
Is there any functionality to display unclaimed row(Couponcode).
Please suggest how to move further
%%[ var @coupon, @couponcode set @subkey = _subscriberkey set @Rows = LOOKUPORDEREDROWS('Master_Data_Extention_Optin',1,'claimed DESC','Contact_ID',@subkey,'claimed','No') Set @rowCount1 = RowCount(@Rows) IF @rowCount1 > 0 then set @Rs1 = Row(@Rows,1) set @AssetId = Field(@Rs1,'Asset_ID') set @claim_row = ClaimRow('CouponCode_Smartphone','IsClaimed','SubscriberKey',@subkey,'Asset ID','@AssetId') IF EMPTY(@claim_row) THEN set @coupon = 'error' ELSE set @couponcode = FIELD(@claim_row,'CouponCode') UpsertDE('Ent.Master_Data_Extention_Optin',2,'Contact_ID',@subkey,'Asset_ID',@AssetId,'claimed','Yes') ENDIF ENDIF ]%%