Delivery Template | Community
Skip to main content
Level 2
March 20, 2026
Question

Delivery Template

  • March 20, 2026
  • 3 replies
  • 43 views

Hi Team,

I have a CSV file that includes first name, last name, and a delivery internal name. I want to use a fixed workflow in Adobe Campaign Classic—consisting of Data Loading → Enrichment → Delivery. The workflow should automatically select the correct email delivery template based on the delivery internal name provided in the CSV and then send the emails. Since a new CSV file arrives every day with different delivery templates, how can I automate this process? please share step by step process

 

Note : This need to achieve in adobe campaign classic V8

 

@Jennifer_Dungan

 ​@AmitVishwakarma 

@SatheeskannaK

@Heather_Kulbacki 

@giuseppebaglio 

@ParthaSarathy 

3 replies

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
March 20, 2026

Hi ​@AdobeWisdomWarrior, unfortunately, I don’t have Adobe Campaign, so I am not the best person to help with this. Hopefully someone with proper experience will be able to support you. Good Luck!

Adobe Employee
March 21, 2026

it requires some JS programming skills.  Activities: Data loading → reconcile with recipients → Advanced JS → Query → recurring delivery
In the advanced JS, you need to select the delivery template names distinct.  I terate over the delviery template names and per delivery template name you

  • Look up the ID of the delivery template
  • add the template name to the vars container (e.g. vars.deliveryTemplateName = ...)
  • add the template ID to the vars container (e.g. vars.deliveryTemplateID = ...)
  • you trigger one outbound transition

Once you are done iterating over all the delivery template names, you trigger another outbound transition to continue processing (or the end).

In the query you select all records from the file WHERE @deliveryTemplateName == $(vars/@deliveryTemplateName)

In the Advanced tab of the delivery, you reconfigure the activity.  I think the command would be activity.delivery_id = vars.deliveryTemplateID

and that should do it

Level 2
March 23, 2026

Hi ​@JuergenNa 

Could you please explain the steps in detail and also share the JavaScript code along with the configuration required in Delivery? share Screenshot its more helpful.

AmitVishwakarma
Community Advisor
Community Advisor
March 22, 2026

Hi ​@AdobeWisdomWarrior 

You cannot make the standard Delivery activity change its template per row. To drive templates by internal name from a CSV, use a JavaScript activity + nms.delivery.SubmitDelivery (business API) inside your fixed workflow. Below is the minimal, production‑safe pattern.

1. Prereqs

Create one email delivery template per use case

CSV structure (daily file) – e.g.:

Email;FirstName;LastName;TemplateInternalName
john.doe@example.com;John;Doe;welcome_email_tpl
jane.roe@example.com;Jane;Roe;promo_email_tpl

2. Workflow layout (fixed, reusable)

Use this once; only the file changes daily:

  • Scheduler – run every day after the file lands.
  • Data loading (file)
    • Load CSV into a temp schema, e.g. temp:importDailyMail
    • Columns: email, firstName, lastName, tplInternalName (and anything else).
  • JavaScript code activity (Send by template) – this is where we select templates and send.

No Delivery activity needed; the JS creates real deliveries from the templates.

 

3. Core JavaScript (template-driven send)

Put this in the JavaScript code activity:

// 1) Load all rows from the temp table
var q = xtk.queryDef.create(
<queryDef schema="temp:importDailyMail" operation="select">
<select>
<node expr="@email"/>
<node expr="@firstName"/>
<node expr="@lastName"/>
<node expr="@tplInternalName"/>
</select>
</queryDef>
);

var rows = q.ExecuteQuery();

// 2) Group recipients by template internal name
var byTpl = {};
for each (var r in rows.temp_importDailyMail) {
var tpl = String(r.@tplInternalName);
if (!byTpl[tpl]) byTpl[tpl] = [];
byTpl[tpl].push(r);
}

// 3) For each template, build externalsource payload and call SubmitDelivery
for (var tplName in byTpl) {
var list = byTpl[tplName];
if (!list.length) continue;

// Build pipe-separated file content expected by the template
// Header must match the template's fileFormat definition
var buffer = [];
buffer.push("Email|FirstName|LastName");
for each (var r in list) {
buffer.push([
r.@email,
r.@firstName,
r.@lastName
].join("|"));
}
var payload = buffer.join("\n");

// Build delivery XML fragment
var deliveryXml =
<delivery>
<targets fromExternalSource="true">
<externalSource>{payload}</externalSource>
</targets>
</delivery>;

// Create and start a delivery from the template
nms.delivery.SubmitDelivery(tplName, deliveryXml);
}

This uses the business API nms.delivery.SubmitDelivery, which takes:

Amit Vishwakarma - Adobe Commerce Champion 2025 | 16x Adobe certified | 4x Adobe SME
Level 2
March 23, 2026

Thanks ​@AmitVishwakarma  I need to send it using the Delivery template because the Delivery process is managed by the design team, and they update the internal delivery name in the Excel file.