


Hi all.
I would like to know if there is any way to send email via javascript code and show the results in the dashboard panel.
This is my workflow:
Payload to send trought htttp request of each contact
{
"request_id":"<%= (String("xxx") + message.id.toString().replace(/,/g, "")).slice(( String("123") + message.id.toString().replace(/,/g, "")).length - 10) %>-<%= substring(1, 9) %>",
"original_dt":"<%= formatDate(new Date(), "%4Y-%2M-%2D") %>T00:00:00.000Z",
"config":{
"service_type":"ssssxd",
"asap":false,
"start_at":"<%= formatDate(new Date(), "%4Y-%2M-%2D") %>T00:00:00.000Z",
"on_behalf_of":"nsc",
"on_behalf_buno":null,
"playbook":"presms_3retries_ws",
"call_script":"always_on",
"cta":{
"offering":"TMKT",
"channel":"event_host",
"source":"Event",
"button":null,
"product_id":"<%= x.product_display_code %>",
"vin":null
},
"crm":{
"brand":"XXX",
"campaign_id":"1-9881sdakjsdjk7413468",
"campaign_name":"TEST_TEST",
"treatment_id":"1-118239140233",
"lead_ctx":"TEST_TEST",
"segment":"<%= targetData.x%>",
"event_name":"test",
"event_location":null
}
},
"contact":{
"camp_member_id":null,
"carmen_id":"<%= contactES.contactProfilerES.src_contact_id %>",
"ucid":null,
"Salutatio":"<%= contactES.contactProfilerES.gender %>",
"test":"<%= contactES.first_name.toUpperCase() %>",
"test":"<%= contactES.last_Name.toUpperCase() %>",
"test":"<%= contactES.second_last_Name.toUpperCase() %>",
"test":"IDESP",
"test":null,
"email":"<%= contactES.main_email_address %>",
"telephone":"<%= contactES.mobile_phone_number %>",
"zipcode":null,
"consents":{
}
}
}
Views
Replies
Sign in to like this content
Total Likes
Hi,
you can create a delivery via javascript and add it to the campaign; then the delivery will show up in the campaign dashboard. Example:
var deliveryTarget = <delivery> <targets> <deliveryTarget> <targetPart type='query' exclusion='false' ignoreDeleteStatus='false'> <where> <condition expr='[@folder-id] = 1050'/> </where> </targetPart> </deliveryTarget> </targets> </delivery>; var templateName = 'myTemplate'; var deliveryXml = nms.delivery.CreateFromModel(templateName, deliveryTarget); var delivery = nms.delivery.create(deliveryXml); var operationId = 1234; delivery.operation_id = operationId; delivery.scheduling.validationMode = "auto"; delivery.validation.useBudgetValidation = false; delivery.validation.useContentValidation = false; delivery.validation.useTargetValidation = false; delivery.validation.useFCPValidation = false; delivery.save(); nms.delivery.PrepareFromId(delivery.id);
In the code above the operationId is the operation/@id attribute of the campaign.
Best regards, Tobias
Hi,
you can create a delivery via javascript and add it to the campaign; then the delivery will show up in the campaign dashboard. Example:
var deliveryTarget = <delivery> <targets> <deliveryTarget> <targetPart type='query' exclusion='false' ignoreDeleteStatus='false'> <where> <condition expr='[@folder-id] = 1050'/> </where> </targetPart> </deliveryTarget> </targets> </delivery>; var templateName = 'myTemplate'; var deliveryXml = nms.delivery.CreateFromModel(templateName, deliveryTarget); var delivery = nms.delivery.create(deliveryXml); var operationId = 1234; delivery.operation_id = operationId; delivery.scheduling.validationMode = "auto"; delivery.validation.useBudgetValidation = false; delivery.validation.useContentValidation = false; delivery.validation.useTargetValidation = false; delivery.validation.useFCPValidation = false; delivery.save(); nms.delivery.PrepareFromId(delivery.id);
In the code above the operationId is the operation/@id attribute of the campaign.
Best regards, Tobias