Expand my Community achievements bar.

SOLVED

Personalisation of emails with data from one-to-many relation tables?

Avatar

Level 2

Hi there! 

I have been puzzling a bit with how much it is possible to personalise emails. It seems that apparantly you can "only" use recipipient specific 1st level data to insert dynamic and personalised content.  

I was wondering if it is possible to somehow insert other data from tables that may contain more than 1 row per recipient. 

Use-case:
I want to insert a voucher code into an email. There can be multiple vouchers related to the recipient but I want to sort decending on the most recent and unused voucher and insert that one. 

Currently we are setting that voucher in the workflow as targetData.voucher BUT that seems like a lot of work since I am unable to send proofs when it is related to target data. Therefore I am looking to insert it directly when editing the email delivery. 


Maybe it is possible with javascript somehow? 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

It's perfectly possible to use a one-to-many relation to Recipients to personalise deliveries, what you have to do is

  1. Data Model: Ensure you have a link to Recipient from the many part of the relation
  2. Workflow
    1. After the Schedule/Start activity, do a a fork with 2 branches
    2. Branch 1: Query your recipient entity
    3. Branch 2 Query the many entity to bring all the records you're interested in (for instance voucher that has not been redeemed yet or voucher that has not been sent to customer yet), Add any attributes from the entity as Additional Data then do a Change Dimension to bring back the Targeting dimension to Recipient (hence the link on Data Model step)
    4. Join Branch 1 and Branch 2 via an Intersection activity, 
    5. Do a dedup on Recipient email/id to keep only 1 voucher per recipient 
    6. Use the voucher in Target Data as field in the delivery

That should work, 

Thanks

Denis

  1.  

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi,

It's perfectly possible to use a one-to-many relation to Recipients to personalise deliveries, what you have to do is

  1. Data Model: Ensure you have a link to Recipient from the many part of the relation
  2. Workflow
    1. After the Schedule/Start activity, do a a fork with 2 branches
    2. Branch 1: Query your recipient entity
    3. Branch 2 Query the many entity to bring all the records you're interested in (for instance voucher that has not been redeemed yet or voucher that has not been sent to customer yet), Add any attributes from the entity as Additional Data then do a Change Dimension to bring back the Targeting dimension to Recipient (hence the link on Data Model step)
    4. Join Branch 1 and Branch 2 via an Intersection activity, 
    5. Do a dedup on Recipient email/id to keep only 1 voucher per recipient 
    6. Use the voucher in Target Data as field in the delivery

That should work, 

Thanks

Denis

  1.