Testing event jinja can be tricky as the setup is curated to fetch data from trigger event - meaning if you would like to test it using TEST TAB PREVIEW the render is not accurate as PREVIEW will take random event (matching event type specified in event jinja) and fetch the data from there making the PREVIEW inaccurate.
For the most accurate render you would need to recreate whole customer journey using scenario and testing profile with following steps:
1. Create a scenario with now trigger
2. Create a condition to match only your testing profile and connect it with now trigger
3. This is most crucial step - reate a add event node which would be creating trigger event and connect it to condition and do not forget to check Allow scenario triggering.
Make sure that the event contains all the data you need to pull to the template, in the example above the property with name "property" is pulled and string "test" is populated. This will mean that in your final render when using event jinja {{ event.property }} the word "test" will be applied.
You can utilise the logic above to add more properties at once to the event that you can pull into your render for example:
This demonstration above demonstrates how you can track all the properties into the event that you are referencing inside the email so all of them can be pulled in and rendered
4. Start a new branch with on-event trigger matching the add event node
5. Create a condition to match only your testing profile and connect it with on-event trigger
6. Create a template that contains code with on-event jinja and connect it to condition
Now all that needs to be done is to start scenario, first branch will add event to test profile which will trigger on-event branch below resulting in correct output
ALTERNATIVE OPTION
If above seems like a no-go you can utilize aggregate like below
This aggregate will fetch value of last custom event in the profile, meaning it will be always overwritten with the most recent one.
Now you can create scenario with now trigger, connect it to condition for your testing profile that has custom event on the profile already and add email node .
The setup looks like below:
Template needs to reference aggregate using code {{ aggregates ['id'] }}
NOTE: You need to create one aggregate for every property you want to reference in the email