Expand my Community achievements bar.

SOLVED

APPLYING COUPON CODE IN DELIVERY SCRIPTS?

Avatar

Level 1

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

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

 

Marcel_Szimonisz_1-1694442367079.png

 

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/

View solution in original post

6 Replies

Avatar

Level 2

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!

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. 

Avatar

Correct answer by
Community Advisor

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

 

Marcel_Szimonisz_1-1694442367079.png

 

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/

Avatar

Administrator

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

Avatar

Level 1

Thanks Marcel. This sounds like  it might be a potential solution.

 

I'm on leave currently, but will confirm, once I've had a chance to test it. 

 

Avatar

Administrator

Hi @Adobeuser000,

Can you please let us know if you were able to try @Marcel_Szimonisz's potential solution?



Sukrity Wadhwa