Access to targetData and recipients from Delivery Script

Avatar

Avatar

guillermoL

Avatar

guillermoL

guillermoL

25-08-2017

Hi,

I'm working on a workflow and I would like to be able to read the 'Target Extension' (targetData object) of the workflow on a script that I want to include on the 'Script' tab of a Delivery in the workflow (see img below) Also I would need to have more details about the recipient list fed from the workflow into the delivery.

1286112_pastedImage_1.png

I can use with no problem the objects targetData and recipient on the body of the delivery itself, but not on this script tab.

Can anyone give a hand please?

Thanks in advance

Guillermo

View Entire Topic

Avatar

Avatar

Jean-Serge_Biro

MVP

Avatar

Jean-Serge_Biro

MVP

Jean-Serge_Biro
MVP

25-08-2017

In your specific use case, use rather the easiest way:

Click on the Subject (objet in French) of your template mail, then you can do whatever you want with Javascript and targetData object ready for you, and most of all, accurate to the specific recipientId (or Subscriber or whatever is your delivery mapping):

1286157_pastedImage_0.png

Because, in the Delivery script tab, it is more for global treatment, with specific treatment in the for each loop.

The same kind of use case is when you want to attach a file depending on the targetData context: click on Attach link, then add your file and click on Advanced detail form to add your Javascript test with targetData object usable.
But do it in the Delivery script if the test for adding or not the attached file is far more complex than the data of targetData.
(hoping I am enough clear, sorry English is not my native language.)

Regards
J-Serge