Sending emails through calling API in javascript | Community
Skip to main content
November 9, 2020
Question

Sending emails through calling API in javascript

  • November 9, 2020
  • 1 reply
  • 2434 views

Hi Folks, 

 

My task is to send emails through API methods which are available in adobe campaign classic. 

 

I am pulling records from query activity and the next i am placing a javascript node and calling the method : 

 

logInfo(NLWS.nmsDelivery.SubmitDelivery("prdDM30931",""); where prdDM30931 is the delivery template name which i created manually. 

 

this is the method declaration given in documentation. 

Number deliveryId = SubmitDelivery ( String       scenarioName, XML          content )

so i assume something has to be given in 'XML content' section but there is no clear notes what to give there. 

 

my workflow looks like this :

 

 

 

i have given a sample xml like the below : 

 

NLWS.nmsDelivery.SubmitDelivery("prdDM30931",<delivery>

<targets>

<deliveryTarget>

<targetPart type='query' exclusion='false' ignoreDeleteStatus='false'>

<where>

<condition expr={'@id ='+ ctx.recipient.@id}/>

</where>

</targetPart>

</deliveryTarget>

</targets>

</delivery>)

 

and it throws error saying ctx is not defined. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Jonathon_wodnicki
Community Advisor
Community Advisor
November 9, 2020

Hi,

 

There isn't a ctx parameter in the SubmitDelivery method.

If you're trying to recreate Message Center, use SubmitNotification, which has a target param:

 

<delivery> <targets> <deliveryTarget> <targetPart> <where> <condition expr="@id=123"/> </where> </targetPart> </deliveryTarget> </targets> </delivery>

 

Thanks,

-Jon

RamaswamiAuthor
November 11, 2020

I just want to send real emails not the notifications through the API function from javascript. 

 

the target will be coming from the query activity and in the api call i need to pass the respondents which i got from query activity. Is there a documentation on how to do that. 

 

i found documentation functions like https://docs.adobe.com/content/help/en/campaign-classic/technicalresources/api/sm-operation-StartDelivery.html 

 

but i want to send delivery by passing respondent emails from query activity through api functions.