Adding additional personalization data in BuildPreviewFromId function | Community
Skip to main content
richac96395021
August 21, 2019
Solved

Adding additional personalization data in BuildPreviewFromId function

  • August 21, 2019
  • 3 replies
  • 3511 views

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.
Best answer by Jonathon_wodnicki

Hi,

Previews will generate same output as deliveries to seeds:

Thanks,

-Jon

3 replies

Jonathon_wodnicki
Community Advisor
Community Advisor
August 21, 2019

Hi,

For targetData, you need to use seeds:

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

Thanks,

-Jon

Florian_Courgey
August 26, 2020

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 

richac96395021
August 21, 2019

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

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
August 21, 2019

Hi,

Previews will generate same output as deliveries to seeds:

Thanks,

-Jon