🔥 100+ people already subscribed. Why not you? Get the monthly newsletter with handy code snippets, tips, and marketing automation insights.

background shape
background shape

How to Build a Custom Coupon Module in Adobe Campaign Without the Standard Package

While Adobe Campaign Classic’s Coupon Management Package offers structured functionality for handling vouchers, it often comes at a price. Enabling this module usually requires additional licensing or professional service consultations, which can delay delivery and inflate project costs. When you’re under time pressure or need a fast, flexible solution, reaching for the standard package might not be your best move.

In the corporate world, such additions often need to go through multiple layers of approval, budgeting, and procurement—sometimes taking weeks or even months. But when a campaign manager comes in on Monday asking for vouchers to go live next week, there’s simply no time to wait. In these situations, you need a fast, flexible alternative that you can fully control and deploy without external dependencies.

In this article, I’ll walk you through how to build a custom coupon module in Adobe Campaign Classic—using native features only. No add-ons. No license barriers. Just a practical solution that works under pressure.

Adobe Campaign Classic Standard Coupon Management Module package

Create List to hold vouchers

First, we need to create a dedicated list (or custom table) to store the vouchers. The structure should include at least the following columns:

  • Voucher Code
  • Date Assigned
  • Recipient Identifier (this can be the primary key from your recipient table, e.g. @id)

You can also add additional columns based on your business needs, such as:

  • Order Number (if the voucher is linked to a transaction)
  • Secondary Recipient Identifier (e.g., email or CRM ID)
  • Status (e.g., Available, Assigned, Redeemed, Expired)

This setup allows you to track the lifecycle of each voucher and maintain a clean assignment history.

When structure is decided, the last step is to load the new vouchers using a simple file load activity.

Workflow to load new vouchers to adobe campaign classic
  • Load vouchers – csv file with only one column called voucher
  • Enrichment: add voucher fields to the structure – Add any additional voucher fields to the structure by simply including empty columns you’ll need later. For text fields, use '' (empty string), and for numbers, use 0. This ensures the list automatically sets the correct data type for each column

Assign vouchers in workflow

Now that we have our vouchers loaded into the list, we’ll use them in our campaign workflow in the next section. First, we add an empty enrichment activity to generate a new temporary table, and we name it enrichTargetData.

TIP: The Name refers to the internal name of the activity. You need to open the activity and define it in the Advanced tab.

in our case we called it First, we assign the vouchers, then fork the population. The top branch is used to create a new transition, where we replace its population with today’s assigned vouchers. This helps with quicker assignment or in cases where a recipient already received a voucher in a previous send—we simply give them another one.

The bottom branch contains our original targeting population. In the enrichment activity, we perform an inner join between the vouchers and the target population to create a new column called voucher. Once this is done, we can use the voucher directly in the email template where needed.

JS – assign vouchers

This script automates the assignment of voucher codes from a list (grp1000) to recipients fetched from temporary workflow data (enrichTargetData). It matches vouchers one-to-one and records the assignment for future reference or exclusion.

var results = sqlSelect("resultQuery,@voucher:string",
    "select svoucher from grp1000 where iRecipientId = 0 LIMIT 2000"),
    vouchers = [],i, sql;
    
for each(var result in results.resultQuery)
  vouchers.push(result.@voucher)
  
var selectExpr = [
    { expr: '@id'},
    { expr: '@orderNumber'}
  ],
  nlQueryDef = new NL.QueryDef("temp:enrichTargetData", selectExpr, []),
  target = nlQueryDef.create().execute().data,  
  d = new Date();
 
  
 if (vouchers.length < target.length) logError("Not enough vouchers.");
 
 for(i=0;i<target.length;i++){
    sql = "UPDATE grp1000 SET sordernumber='"+ target[i].orderNumber +"' + ", irecipientid=" + target[i].id + ", tsdate=CURRENT_TIMESTAMP WHERE svoucher='"+vouchers[i]+"'";
    sqlExec(sql)
 }
  • sqlSelect() pulls up to 2000 unassigned vouchers (iRecipientId = 0) from the grp1000 table.
  • Each voucher is expected to be stored in the svoucher column.
  • Results are stored in results.resultQuery, and individual voucher values are pushed into the vouchers array.
  • A QueryDef is created to fetch data from a temporary table called enrichTargetData (populated earlier in the workflow).
  • It selects @id and @orderNumber for each recipient
  • This data becomes the list of recipients who need a voucher.
  • Ensures that there are enough vouchers for the recipients.
  • Logs an error if the voucher list is too short.
  • Loops over each recipient in the target list.
  • Builds an UPDATE query to:
  • Assign the voucher (svoucher = vouchers[i]) to the recipient
  • Set:
    • sordernumber (order number of recipient)
    • irecipientid (recipient ID)
    • tsdate to current timestamp
  • Runs the sqlExec() to update the database.

Further Improvements to the Custom Voucher Module

To make your custom voucher module more robust, you can

đź”’ This content is for Premium Subsribers only.

Please log in to preview content. Log in or Register

You must log in and have a Premium Subscriber account to preview the content. When upgrading, please provide the same email address as for your WordPress account; otherwise, we will not be able to link your Premium membership. Please also provide your Discord username or contact me directly to get access to the Discord community once your subscription is purchased. You can subscribe even before your account is created; the subscription will be linked to your WordPress email address.

Premium Subscriber

9.99 €4.99 € / Month

  • Access to exclusive blog content
  • In-depth articles not available online
  • Insights from industry experts
  • Free Discord community invite
  • Unlimited questions in Solution Station
  • Limited seats at this price

Oh hey there đź‘‹
I’ve got something special for you—free scripts every month!

Sign up now to receive monthly premium Salesforce Marketing Cloud script examples straight to your inbox.

We don’t spam! Read our privacy policy for more info.

Share With Others

Leave a Comment

Your email address will not be published. Required fields are marked *

MarTech consultant

Marcel Szimonisz

Marcel Szimonisz

I specialize in solving problems, automating processes, and driving innovation through major marketing automation platforms—particularly Salesforce Marketing Cloud and Adobe Campaign.

Related posts