Sending emails through calling API in javascript

Avatar

Avatar

Ramaswami

Avatar

Ramaswami

Ramaswami

09-11-2020

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 :

 

Ramaswami_0-1604940932629.png

 

 

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. 

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

wodnicki

MVP

Avatar

wodnicki

MVP

wodnicki
MVP

09-11-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