Skip to main content
abhinav99
Level 4
May 28, 2024
Solved

How too Migrate Email Templates from an endpoint into Adobe campaign classic

Hi Team,

We are exploring the possibility of migrating email templates, specifically the transactional type, from an external endpoint (GitHub/AWS) into Adobe Campaign Classic.

 

Any idea what could be the approach ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Manoj_Kumar
Manoj_KumarAccepted solution
Community Advisor
May 29, 2024

Hello @abhinav99 

 

I am assuming the external endpoint is returning a JSON object with all values required to create a template.

 

What you can do is read data from the endpoint and create template with some JS code.

 

How to read JSON data from an API:

var req = new HttpClientRequest("ENDPOINT") req.header["Authorization"] = "Bearer " // if any auth is required req.header["Content-Type"] = "application/json"; req.method = "GET"; try { req.execute() } catch(e) { logError(e) } var response = req.response var res=JSON.parse(response.body); req.disconnect()

 

 

You will have the data in res and then you can fetch the data from any available attribute

 

Then create the transactional email delivery with JS Code:

var delivery = nms.delivery.create() delivery.Duplicate("nms:delivery|3714"); // 3714 is the primarky key of default transactional template delivery.eventType=eventType; // change this according to your variables delivery.label = deliveryLabel; // change this according to your variables delivery.content.html.source=deliveryHTMLContent; // change this according to your variables delivery.content.text.source=delvieryTextContent; // change this according to your variables delivery.save();

 

Manoj  | https://themartech.pro

4 replies

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
May 29, 2024

Hello @abhinav99 

 

I am assuming the external endpoint is returning a JSON object with all values required to create a template.

 

What you can do is read data from the endpoint and create template with some JS code.

 

How to read JSON data from an API:

var req = new HttpClientRequest("ENDPOINT") req.header["Authorization"] = "Bearer " // if any auth is required req.header["Content-Type"] = "application/json"; req.method = "GET"; try { req.execute() } catch(e) { logError(e) } var response = req.response var res=JSON.parse(response.body); req.disconnect()

 

 

You will have the data in res and then you can fetch the data from any available attribute

 

Then create the transactional email delivery with JS Code:

var delivery = nms.delivery.create() delivery.Duplicate("nms:delivery|3714"); // 3714 is the primarky key of default transactional template delivery.eventType=eventType; // change this according to your variables delivery.label = deliveryLabel; // change this according to your variables delivery.content.html.source=deliveryHTMLContent; // change this according to your variables delivery.content.text.source=delvieryTextContent; // change this according to your variables delivery.save();

 

Translate
Manoj  | https://themartech.pro
Michael_Soprano
Level 10
June 3, 2024

But in which functionality can I use this JS code. Already in email creation template?

Translate