Hi All,
I have a requirement to send a test email to a user using the delivery API method (submit delivery).
Adobe Campaign will receive all campaign and recipient email information from the upstream part of the SOAP implementation. We (AC) just need to receive that data and deliver the test email to the recipient's email address within a few minutes.
Any leads or suggestions on how to achieve this would be appreciated.
Thanks in advance!
@ccg1706 @ParthaSarathy @_Manoj_Kumar_ @Craig_Thonis @DavidKangni
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @PSNe,
The issue appears to be related to how targetData attributes are managed in the submitDelivery API.
I share with you some possible solutions:
*Check that the targetData includes the correct and required attributes.
*Check that the personalization block is configured to handle the targeData attribute.
** Whereas using <%= targetData.firstName %> replace it with <%targetData['firstName'] || ''%> This will evict error if the firstName attribute is null or undefined.
Other solutions that you can try are to include the targetData inside the payload or also take into consideration mapping the targetData attributes to the recipient fields.
An example of a payload modified is:
{
"messageType": "email",
"targetData": {
"firstName": "John"
},
"recipients": [
{
"email": "example@example.com"
}
]
If here targetData doesn't work correctly, you can move its values inside the recipient object.
Hope it helps.
Regards,
Celia
Hello @PSNe,
You can use SubmitNotification method of delivery schema to do so.
Here is documentation of the method : click here
Br
Hi @Amine_Abedour / @ccg1706 ,
Thanks for your response. How can I replace the dynamic personalization values in the email content during delivery before calling the submitDelivery function? Using submitDelivery, I can send out the delivery, but I have a use case where I receive the HTML from an API and need to personalize it based on target attributes.
Thanks!!!!
Views
Replies
Total Likes
Hi @PSNe,
I share with you a possible approach, you will need to use your API to get the HTML template, pull in the personalization data that you need, this could be from you database or doing and API call with the specific recipient information that you need.
In a JavaScript activity before calling submitDelivery, change placeholders in the HTML with current values. I share with you a solution as a guidance:
var htmlContent = "<html>...Hello %%name%%...</html>";//Example with HTML
var targetData = { name: recipient.firstName };
htmlContent = htmlContent.replace("%%name%%", targetData.name);
//Replace with real data
Once the HTML is updated attached it to the submitDelivery to send it out. In this way, each recipient gets a version of the email that's personalized just for them.
I leave you with some documentation links:
Personalization dynamic content
JavaScript scripts and templates
Regards,
Celia
Thank you for the suggesting approach. I will try to work on these.
Hi @ccg1706 ,
I tried with submitDelivery API method and able to send email using this method . problem i am facing when replacing targetData.attribute using PB .
I am using custom table and adding the PB in delivery Template to replace the firstName (firstname being passed as additional data in the wk).
Same thing working fine when using <%= recipient.firstName %> at PB level.
is there any limitation with submitDelivery Method which blocking to use targetData.attribute.
This is the delivery error i am getting:
Views
Replies
Total Likes
Hi @ccg1706 & @Amine_Abedour,
Can any one of you please help @PSNe with their query?
Thanks!
Hi @PSNe,
The issue appears to be related to how targetData attributes are managed in the submitDelivery API.
I share with you some possible solutions:
*Check that the targetData includes the correct and required attributes.
*Check that the personalization block is configured to handle the targeData attribute.
** Whereas using <%= targetData.firstName %> replace it with <%targetData['firstName'] || ''%> This will evict error if the firstName attribute is null or undefined.
Other solutions that you can try are to include the targetData inside the payload or also take into consideration mapping the targetData attributes to the recipient fields.
An example of a payload modified is:
{
"messageType": "email",
"targetData": {
"firstName": "John"
},
"recipients": [
{
"email": "example@example.com"
}
]
If here targetData doesn't work correctly, you can move its values inside the recipient object.
Hope it helps.
Regards,
Celia
Hi @PSNe,
You can follow @Amine_Abedour approach.
Additionally you can use SubmitDelivery Method .
Take into account that you need to be sure when you are doing the SOAP request to pass the correct information via the API.
Kind regards,
Celia
Views
Likes
Replies
Views
Likes
Replies