Get recipients from a API to delivery and send an email

Avatar

Avatar

ags

Avatar

ags

ags

24-03-2021

I have a requirement to send a personalized delivery, the data comes from an API call with HttpClientRequest("url");.

But I'm not sure if the workflow recognize the recipients in the inbound event, or the javascript allow me create a temp schema or only if I insert the data into recipient schema is enough or is impossible do this kind of things.

 

I don't now how the template derivery could recognize the recipients. 

 

ags_2-1616635659107.png

 

Thanks for your help.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Darren_Bowers

MVP

Avatar

Darren_Bowers

MVP

Darren_Bowers
MVP

24-03-2021

Hi @ags - Yes you can do this but it would be up to you how you want to treat the incoming targets. You can choose to add them as Recipients in the Javascript, then load them from the Recipient table further in the workflow. You can also save the new targets into a temporary table and again retrieve them as your targets before the send. There are a few options you have available.

Typically what you also want to do (whichever way you choose) is have some way to identify them again, either by putting them in a specific recipient folder when you add them, or some unique identifier when you add them to a temporary table. This helps retrieve them later in the workflow

Cheers

Darren

Answers (2)

Answers (2)

Avatar

Avatar

ags

Avatar

ags

ags

25-03-2021

Thank you @wodnicki @Darren_Bowers you help me a lot 

Avatar

Avatar

wodnicki

MVP

Avatar

wodnicki

MVP

wodnicki
MVP

24-03-2021

Hi,

 

I once made a workflow activity that allows for arbitrary service enrichment ala the ootb enrichment activity, was not easy (temp schema manipulation is undocumented).

The easy way is to not manipulate the temp schema:

  1. Query for desired recipients, adding empty fields as desired. E.g. if your email is recipient + credit scores from service, add a field in Additional data called @creditScore with expr=''
  2. Use JS to batch query the service to populate the blank cols with xtk. The temp schema is called {vars.schema}

NB hardcoding the fields is essentially 'throw away' work as it can't be reused past whatever's implemented.

If data is static or non-time-sensitive consider using ETL processes to populate permanent tables instead.

 

Thanks,

-Jon