Hi there,
I am building a solution whereby I have built a custom schema which will be populated with data that will act as content for an email newsletter (many fields to help populate various text and images placeholders in the HTML email in a delivery - the marketer will upload a csv file to populate the schema)
The custom schema is joined to the nms:delivery schema on a 1-n cardinality (1 record in the custom schema can have many records in the nms:delivery schema but a delivery can only have 1 corresponding record in the custom schema)
I use the primary key field ‘variationReference’ from the custom schema to join to the nmsDelivery schema (have created a field on the deliveries schema with the same name/type to act as foreign key).
The marketer will then upload a record to the custom schema and set the appropriate ‘variationRef’ on the delivery.
There will then be a reuseable HTML that will be used for any delivery using this process.
It uses the following syntax to populate data from the appropriate row from the custom schema:
<%= message.delivery.customSchemaLinkName.fieldName %>
There are lots of these tags to populate data and also if/else statements to handle nulls etc.
The solution is working as expected, the only challenge I face is around scalability.
When I have tested preparing a delivery to a million recipients, the message preparation part of the analysis takes around an hour?
Is there a better way to design my solution / retrieving the personalisation data from the custom schema. I’m guessing it’s working hard to retrieve data for each recipient when in reality every recipient needs the same content and it’s only one row of data needed to personalise per delivery.
any advice greatly appreciated
thanks
David
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @davidh2892249 ,
Yes there is a better way, you can use the OOTB Personalization tab in delivery properties to query your schema,
get the coresponding line for your delivery and store it in a Javascript object that you can use in your HTML :
Br,
Amine
Views
Replies
Total Likes
Hello @davidh2892249 ,
Yes there is a better way, you can use the OOTB Personalization tab in delivery properties to query your schema,
get the coresponding line for your delivery and store it in a Javascript object that you can use in your HTML :
Br,
Amine
Views
Replies
Total Likes
Hi Amine
Thanks so much for your reply, this makes a huge difference to the message preparation time (thought there was something amongst those tabs that would help).
Just as an extra step, I've tested applying those settings with javascript through the "object modification script" on a delivery activity - so that I can continue to use a single "master" delivery template, but then retrieve different records from the custom schema for different campaigns/segments.
e.g.
delivery.content.addExtraObject = 1; //enables additional object
delivery.content.extraObject.jsName = "exampleObject"; //names the js object
delivery.content.extraObject.lineCount = "1"; //retrieve a single row
delivery.content.extraObject.schema = "cus:exampleSchema"; //name of custom schema
delivery.content.extraObject.startPath = "/"; //set root path
delivery.content.extraObject.where.condition.expr = "@fieldName = 'xxxxx'"; //expression for record to retrieve
Kind Regards
David