Hi Jean,
I am trying to send an email using submit delivery method but getting an following error.
09/04/2018 09:35:41 SCR-160012 JavaScript: error while evaluating script 'WKF11540/js'.
09/04/2018 09:35:41 SOP-330011 Error while executing the method 'SubmitDelivery' of service 'nms:delivery'.
09/04/2018 09:35:41 DLV-490051 Failed to analyze delivery (identifier 'unknown').
09/04/2018 09:35:41 DLV-490050 The XML document to add to the scenario does not have a valid format.
09/04/2018 09:35:41 Element 'targetPart' is unknown (see definition of element '/targets' in schema 'Deliveries (nms:delivery)').
Can I pass targets and content inside submit delivery method?
Thanks
Naveen S
Solved! Go to Solution.
Thanks Jean for you reply.
I have figured out in the script it was some variable issue.
You can close the ticket
Regards
Naveen
Views
Replies
Total Likes
Here is the code.
var abc = "<html><body><p>text</p></body></html>"
var deliveryId = nms.delivery.SubmitDelivery("DM79018",<delivery>
<targets >
<deliveryTarget >
<targetPart exclusion='false' ignoreDeleteStatus='false'>
<where>
<condition expr="@email = 'naveen@xyz.com'"/>
</where>
</targetPart>
</deliveryTarget>
</targets> <content>
<html>
<source>{abc}</source>
</html>
</content>
</delivery>);
logInfo(deliveryId)
Views
Replies
Total Likes
I am trying your code to send delivery but its not working for me
nms.delivery.QueueNotification('mediaconfirmation',
<delivery>
<targets>
<deliveryTarget>
<targetPart exclusion='false' ignoreDeleteStatus='false'>
<where>
<condition expr={"@email='"+ctx.vars.MEmail+"'"}/>
</where>
</targetPart>
</deliveryTarget>
</targets>
</delivery>)
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi Naveen,
Please may you read the SubmitNotification method in the JSAPI.chm documentation, it is more detailed about the 3 possibilities for the target element than submitDelivery method (for which the documentation doesn't give any example, except one in JSON but not for target part).
For instance, in the SubmitDelivery method, you can write:
<targets >
<deliveryTarget>
<targetPart>
<where filteringSchema="nms:recipient">
<condition expr="@email = 'xxxx@yyyy.com'"/>
</where>
</targetPart>
</deliveryTarget>
</targets >
Regards
J-Serge
Views
Replies
Total Likes
oh your 2nd post and mine have been posted simultaneously
annother example, if you must use it within a webApp Javascript activity:
nms.delivery.QueueNotification('internal-name-of-delivery',
<delivery>
<targets>
<deliveryTarget>
<targetPart type='query' exclusion='false' ignoreDeleteStatus='false'>
<where>
<condition expr={'@id ='+ ctx.recipient.@id}/>
</where>
</targetPart>
</deliveryTarget>
</targets>
</delivery>);
Regards
JS
Hi naveens,
Please may you add the missing attribute in targetPart:
type='query'
Regards
JS
After adding type="query" In submitDelivery its not working but it works in submit notification but I need feed content as well.
Views
Replies
Total Likes
Hi Naveens,
SubmitNotification method is only useful for continuous deliveries (adding new target contacts, not for changing the delivery content).
I mentioned it because of the 2 other methods described in the documentation for target feed (external file etc).
It is weird why an error still occurs after type='query' added. Sorry I don't undertand. Is the mistake the same?
Is your delivery DM79018 a standard one, or recurrent one, or continuous one ?
(in that latter case, again it is Submit Notification that must be used, but with no content change.)
Can you copy/paste the xml code in a text editor (such as Notepad++, Ultraedit, etc) in order to see if you have special characters in it, not visible/shown as blank char?
Please may you try also with :
<where filteringSchema="nms:recipient">
<condition expr="@email = 'xxxx@yyyy.com'"/>
Regards
JS
Hi Jean,
I have created a template and utilizing that template internal name and trying to target population dynamically by passing email through variable and content too dynamic.
I have removed type="query" and Submitdelivery its working fine now but I couldn't be able to pass email address has a variable inside experssion.
here is the code
var abc = "<html><body><p>xxx</p></body></html>"
var emailId = "abc.xyz@yyy.com"
var deliveryId = nms.delivery.SubmitDelivery("DM79018",<delivery>
<targets >
<deliveryTarget >
<targetPart exclusion='false' ignoreDeleteStatus='false'>
<where>
<condition expr={'@email=' +emailId}/>
</where>
</targetPart>
</deliveryTarget>
</targets>
<content>
<html>
<source>{abc}</source>
</html>
</content>
</delivery>);
logInfo(deliveryId)
Thanks Jean for you reply.
I have figured out in the script it was some variable issue.
You can close the ticket
Regards
Naveen
Views
Replies
Total Likes
can you share your code i am going through same issue
Views
Replies
Total Likes
Views
Likes
Replies