Adding additional personalization data in BuildPreviewFromId function | Community
Skip to main content
richac96395021
Level 4
Aug 21, 2019 9:37 AM UTC
Solved

Adding additional personalization data in BuildPreviewFromId function

Hi team,

We are using BuildPreviewFromId function in javascript, please let me know if we can add more personalization like 'targetData.amount' while calling the function. Below is the function definition:-

var res = nms.delivery.BuildPreviewFromId(

  deliveryId,

  <params content="html" filter="@id=1234"/>)

var preview  = res[0]

var queryResult = res[1]

with regards,

Richa Chaubey

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Jonathon_wodnicki
Jonathon_wodnickiAccepted solution
New Participant
Aug 21, 2019 4:10 PM UTC

Hi,

Previews will generate same output as deliveries to seeds:

Thanks,

-Jon

4 replies

Jonathon_wodnicki
Jonathon_wodnickiAccepted solution
New Participant
Aug 21, 2019 4:10 PM UTC

Hi,

Previews will generate same output as deliveries to seeds:

Thanks,

-Jon

Translate
richac96395021
Level 4
Aug 21, 2019 3:33 PM UTC

Hi Jon,

In the above function definition, how will the target extension attributes will be referred in personalization. For example @amount is part of cus: transactions schema (target extension) and not nms:seedMember schema. How will the preview generate

With regards,

Richa Chaubey

Translate
Jonathon_wodnicki
New Participant
Aug 21, 2019 3:10 PM UTC

Hi,

For targetData, you need to use seeds:

<params content="html" filter="@id = 1234" schema="nms:seedMember"/>

Thanks,

-Jon

Translate
Florian_Courgey
Level 4
Aug 26, 2020 10:10 AM UTC

Thanks! It worked for our custom cus:deliveryPreview.jssp :

var target = request.getParameter("target") || "XXX"; // default to XXX var targetSchema = request.getParameter("targetSchema") || "XXX"; // default to XXX [...] //var deliveryParam = <params content={contentType} filter={decryptedTarget}/>; // replaced by below code var deliveryParam = <params content="html" filter="@id = 0" schema="nms:seedMember"/>; // using a seed address allows deliveries with targetData to work var res = nms.delivery.BuildPreviewFromId(deliveryId,deliveryParam);

 You may now use https://xxx.neolane.net/cus/deliveryPreview.jssp?messageType=0&id=1234&contentType=html 

Translate