From b2dfc283a2f65d1cfeb42e233486063b965ed40a Mon Sep 17 00:00:00 2001 From: Anshul Chauhan Date: Thu, 20 Jun 2024 20:43:26 +0530 Subject: [PATCH] Adding personalization templating examples --- help/using/personalization/examples.md | 125 +++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 help/using/personalization/examples.md diff --git a/help/using/personalization/examples.md b/help/using/personalization/examples.md new file mode 100644 index 000000000..12ded4767 --- /dev/null +++ b/help/using/personalization/examples.md @@ -0,0 +1,125 @@ +```yaml +title: Examples of Template Personalization +description: Journey Optimizer Personalization examples +feature: Personalization +topic: Personalization +role: Data Engineer +level: Experienced +``` + +# Personalization Examples{#examples} + +## Plan-Prescriptions + +**Use Case** + +A profile contains plans, and each plan includes prescriptions. Prescriptions +have various states, such as "ready," "recall," or "picked up." We will send a single email to the person, including all prescriptions that are either ready for pick up or recalled. + +**Solution** + +> [!BEGINTABS] + +> [!Rendered Message!] + +
+

Hi Anshul Chauhan,

+

Here are the prescriptions that are either ready for pick up or have been recalled:

+ +

Health Plan A

+ +

Health Plan B

+ +
+ + + +> [!HTML Template] + +```html +

Hi {{profile.person.firstName}} {{profile.person.lastName}},

+

Here are the prescriptions that are either ready for pick up or have been recalled:

+{{#each profile.plans as |plan|}} +

{{plan.name}}

+ +{{/each}} +``` + +> [!Profile Data] + +```javascript +{ + "profile": { + "person": { + "firstName": "Anshul", + "lastName": "Chauhan" + }, + "plans": [ + { + "planId": "plan1", + "name": "Health Plan A", + "prescriptions": [ + { + "prescription_id": "pres1", + "name": "Medication A", + "state": "ready" + }, + { + "prescription_id": "pres2", + "name": "Medication B", + "state": "recall" + } + ] + }, + { + "planId": "plan2", + "name": "Health Plan B", + "prescriptions": [ + { + "prescription_id": "pres3", + "name": "Medication C", + "state": "picked up" + }, + { + "prescription_id": "pres4", + "name": "Medication D", + "state": "ready" + } + ] + } + ] + } +} +```