Hi @alnavarg,
To send a delivery in Adobe Campaign using JavaScript, you can use the SOAP API provided by Adobe Campaign.
Here is an example code snippet to create a delivery:
// Set up the SOAP client
var soap = require('soap');
var url = 'https://example.com/nl/jsp/soaprouter.jsp?wsdl';
var options = {
forceSoap12Headers: true
};
var client = await soap.createClientAsync(url, options);
// Set up the delivery properties
var delivery = {
name: 'My Delivery',
label: 'My Delivery Label',
startDate: new Date(),
endDate: new Date(),
content: {
type: 'Delivery',
htmlBody: '<html><body>Hello World!</body></html>'
}
};
// Create the delivery
var result = await client.createAsync({ delivery: delivery });
console.log(result);
This code sets up a SOAP client using the soap library, sets the properties of the delivery, and then calls the createAsync method of the SOAP client to create the delivery.
Note that this is just a basic example and you may need to modify the code depending on your specific requirements and the configuration of your Adobe Campaign instance.
Hi @alnavarg ,
Create a new delivery template and in its property Analysis tab > set approval mode as Automatic.
In workflow JavaScript try below script,
var subjectLine = "Subject Line";
var emailBody = "<html><body><p>Email Body Content</p></body></html>";
var recipientID = "123456789";
var deliveryId = nms.delivery.SubmitDelivery("internalNameOfDeliveryTemplate",<delivery>
<targets >
<deliveryTarget>
<targetPart exclusion='false' ignoreDeleteStatus='false'>
<where>
<condition expr={'@id ='+recipientID}/>
</where>
</targetPart>
</deliveryTarget>
</targets>
<mailParameters>
<subject>{subjectLine}</subject>
</mailParameters>
<content>
<html>
<source>{emailBody}</source>
</html>
</content>
</delivery>);
Yes but i want to send it
The above JS had triggered email to the recipient with primary Key 123456789.
You can modify the where condition to target recipients as per requirement.
Hi @alnavarg,
To send a delivery in Adobe Campaign using JavaScript, you can use the SOAP API provided by Adobe Campaign.
Here is an example code snippet to create a delivery:
// Set up the SOAP client
var soap = require('soap');
var url = 'https://example.com/nl/jsp/soaprouter.jsp?wsdl';
var options = {
forceSoap12Headers: true
};
var client = await soap.createClientAsync(url, options);
// Set up the delivery properties
var delivery = {
name: 'My Delivery',
label: 'My Delivery Label',
startDate: new Date(),
endDate: new Date(),
content: {
type: 'Delivery',
htmlBody: '<html><body>Hello World!</body></html>'
}
};
// Create the delivery
var result = await client.createAsync({ delivery: delivery });
console.log(result);
This code sets up a SOAP client using the soap library, sets the properties of the delivery, and then calls the createAsync method of the SOAP client to create the delivery.
Note that this is just a basic example and you may need to modify the code depending on your specific requirements and the configuration of your Adobe Campaign instance.
Views
Likes
Replies
Views
Likes
Replies