APPLYING COUPON CODE IN DELIVERY SCRIPTS? | Community
Skip to main content
September 2, 2023
Solved

APPLYING COUPON CODE IN DELIVERY SCRIPTS?

  • September 2, 2023
  • 2 replies
  • 1752 views

Looking for a delivery script wiz to help with this question:

 

- How do I activated coupon codes from the delivery script? (Rather than directly from the delivery properties/advanced/coupon management!)

 

The purpose behind this is to allow us to enable/disable coupon codes in a single delivery template using multiple delivery activities/nodes.

 

One delivery activity has an inbound audience that does not need  coupons. The other delivery activity with the same delivery template applied, Does need coupons. 

 

Thank you

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Marcel_Szimonisz

Hello @adobeuser000 ,

You can use - delivery object modification script, just change the coupon settings dynamically. How to find coupon  xpathsettings within the delivery object?

 

  • Open delivery template
  • Set the coupon manually
  • Save it
  • Edit --> Edit XML source..
  • look for coupon section <coupon

 

 

It looks like its element directly under delivery and its path is delivery.coupon

 

 

 

<coupon _cs="test (Coupons)" code="BOGO2023" id="5530" type="0"/>

 

 



In delivery object modification script you can access the coupon dynamically with use of:

 

 

//you can access the parameters and set them as you need delivery.coupon.id = 0;

 

 

 

But also it does not matter if you assign coupons to delivery if you do not use them in content.. so you can also create conditions in delivery when to use coupons

 

Marcel Szimonisz

MarTech Consultant
for more tips visit my blog
https://www.martechnotes.com/

2 replies

Gurunath_Selvaraj
Level 2
September 6, 2023

Hi @adobeuser000 , For an one time send instead of script there is a simple way of doing it using the line number as identifier.

Step1: Load your coupons from local computer or dowloand it from SFTP location. Data loading will automatically assign line numbers to the coupon values and add it has a additional data using enrichment.

Step2: Split the audience who needs coupon and generate line numbers to the audience.

Step3: Assign the coupon variable to audience by mapping the line numbers using enrichment.

Step4: Call the coupon varibale in your delivery.

 

In this way the records who don't have line numbers will not receive coupons. You can also track the assigned coupons by extracting the data.

 

Hope this helps!

September 9, 2023

Thanks for taking the time to reply. Unfortunately this method isn't suitable in conjunction with our configuration. Our FT codes are generated automatically at the point of delivery. But it was a great suggestion. 

Marcel_Szimonisz
Community Advisor
Marcel_SzimoniszCommunity AdvisorAccepted solution
Community Advisor
September 11, 2023

Hello @adobeuser000 ,

You can use - delivery object modification script, just change the coupon settings dynamically. How to find coupon  xpathsettings within the delivery object?

 

  • Open delivery template
  • Set the coupon manually
  • Save it
  • Edit --> Edit XML source..
  • look for coupon section <coupon

 

 

It looks like its element directly under delivery and its path is delivery.coupon

 

 

 

<coupon _cs="test (Coupons)" code="BOGO2023" id="5530" type="0"/>

 

 



In delivery object modification script you can access the coupon dynamically with use of:

 

 

//you can access the parameters and set them as you need delivery.coupon.id = 0;

 

 

 

But also it does not matter if you assign coupons to delivery if you do not use them in content.. so you can also create conditions in delivery when to use coupons

 

Marcel Szimonisz

MarTech Consultant
for more tips visit my blog
https://www.martechnotes.com/

Sukrity_Wadhwa
Community Manager
Community Manager
September 27, 2023

Hi @adobeuser000,

Was the given solution by @marcel_szimonisz helpful to resolve your query or do you still need more help here? Do let us know.

Thanks!

Sukrity Wadhwa