ACC Tips & Tricks, Adobe Campaign, Marketing Automation

Pass custom variables to delivery template

Pass custom variables to delivery template

In your delivery, you can use different types of data that can be utilized for personalized content for your customers.

To add a custom variable directly to the delivery from the workflow, you will need to

  1. create delivery variable placeholders in your delivery template
  2. set values to variables within the initialization script of the delivery activity

Create delivery variables

First, you need to create placeholders for delivery variables within your delivery template. These placeholders serve as containers for values we will set later withing the delivery object modification script.

Adobe Campaign Classic - delivery template properties - pass custom parameters
  1. Open delivery template properties
  2. Navigate to the Variables tab.
  3. Add as many variables as you need

You can choose from text, longText, int, float, and date types. Personally, I often opt for text, and when dealing with JSON arrays, I use longText.

Adobe Campaign Classic - set up custom delivery parameters

Set values of delivery variables

Now that we have created delivery variables, we can populate them within the object modification script of the delivery activity. Take a look at the XML source of the delivery template for further insights about where we can find these variable placeholders.

Adobe Campaign Classic - Display delivery template XML source

We can see varibales just under the deliveyr element and can be accessed under the path delivery.variables

<delivery>
  <variables>
    <var calculated="false" dataType="7" doubleValue="0" longValue="0" name="ownDate"
         required="false"/>
    <var calculated="false" dataType="5" doubleValue="0" longValue="0" name="ownFloat"
         required="false"/>
    <var calculated="false" dataType="3" doubleValue="0" longValue="0" name="ownInt"
         required="false"/>
    <var calculated="false" dataType="12" doubleValue="0" longValue="0" name="ownLongText"
         required="false"/>
    <var calculated="false" dataType="6" doubleValue="0" longValue="0" name="ownText"
         required="false"/>
  </variables>

To set values for these variables, access them as you would an array. Pay attention to the order in which you save your variables; the same order must be followed when setting values. In the script above, note that to access the string variable ‘ownText,’ you would need to access the last item in the array

delivery.variables._var[4].stringValue =  'hello';

Now that we have successfully set the variables, we can begin to use them within the delivery template. You can direcly type the variable within the personalization script

<%=variables.ownText%>

Alternatively, if you’re uncertain, you can access them from the dropdown menu. This method is similar to how you access variables from the workflow or recipient.

Adobe Campaign Classic - select delivery parameters from template personalization menu

Oh hi there 👋
I have a FREE e-book for you.

Sign up now to get an in-depth analysis of Adobe and Salesforce Marketing Clouds!

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

#adobe campaign classic #email template #JavaScript #programming #workflow
Marcel Szimonisz
Marcel Szimonisz
MarTech consultant As a marketing automation consultant, I specialize in problem-solving, process automation, and driving innovation for clients' marketing platforms.

I hold certifications in Adobe Campaign v6 (3x certified) and Salesforce Marketing Cloud (5x certified), as well as 1x Salesforce Associate certified.

Moreover, I serve as a community advisor for Adobe Campaign, providing expert insights and guidance.

Beyond my professional pursuits, I explore various programming languages, CMSs, and frameworks, enhancing my technical expertise and staying at the forefront of industry advancements.
Take a look at our subscription offering in case you are looking for a Marketing Automation Consultant.

Similar posts that you may find useful

Digital-themed graphic illustrating the extraction of data deltas from a data extension, featuring a computer screen with a data analysis interface, flowing data streams, and abstract digital patterns and circuitry in the background.
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Extract data deltas from the data extension

5 minutes read

Exporting data deltas from a marketing automation platform like Salesforce Marketing Cloud has been a widely discussed topic. I’ve seen numerous approaches to tackling this challenge. In this post, we’ll explore various methods for extracting data deltas and delve into my personal favorite. Stay tuned to uncover practical strategies that could revolutionize your data management […]

Continue reading
Consent management in SFMC explained
Marketing Automation, Salesforce Marketing Cloud

Consent management in SFMC explained

6 minutes read

Even after a couple of years working with Salesforce Marketing Cloud, I am still somewhat lost on how the consent management works. I’ve decided to tackle all the uncertainties I’ve been avoiding since I first started. Let’s dive into this topic and resolve all doubts once and for all. As you might have noticed, there […]

Continue reading
Salesforce Marketing Cloud Tips
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

How to use MD5 in SQL and AMPScript

1 minute read

Message Digest 5 (MD5) is a hash function used for data integrity, but it is not suitable for security-critical applications. It has found use for various applications, one of which is to create an encrypted contact subscriber key. MD5 takes any string and produces a fixed-size (128-bit) hash value, that cannot be easily decrypted. To […]

Continue reading
How to lock workflow in Adobe Campaign Classic
Adobe Campaign, Marketing Automation

Avoid Editing Conflicts: How to Lock Workflow

6 minutes read

Many times, I have encountered situations where multiple individuals were simultaneously editing the same workflow. In such cases, the version that is saved last ultimately takes precedence. To avoid this issue, a simple solution would be to implement a workflow lock, which can prevent such scenarios from arising. We want to achieve following business logic: […]

Continue reading
Adobe Campaign Classic REST over SOAP
Adobe Campaign, Marketing Automation

Build REST over SOAP API in adobe campaign

4 minutes read

If you’re familiar with Adobe Campaign Classic, you may have noticed that it utilizes the SOAP (Simple Object Access Protocol) API. We live in an age where REST is taking over, and the good old XML SOAP is slowly being forgotten. To me, as an old-timer, I can confidently say that it doesn’t make any […]

Continue reading