parcelvoy / platform

Parcelvoy: Open source multi-channel marketing automation platform. Send data-driven emails, sms, push notifications and more!
https://parcelvoy.com
MIT License
257 stars 47 forks source link

Template cannot access variable in user object for blast campaigns #495

Closed dark-matter08 closed 2 months ago

dark-matter08 commented 2 months ago

I have an email blast campaign and i have configured the template to load the user's name from the user object as seen

Screenshot 2024-08-28 at 13 26 37

And when preview the template after loading a user it works fine and good

Screenshot 2024-08-28 at 13 30 28

but when the campaign is sent and received in my email, the name is not loaded

Screenshot 2024-08-28 at 13 30 42

I also faced the same issue with using webhook on blast campaign, the campaign failed because there user id which was sent in the body object was not received in the api and the following actions all failed

pushchris commented 2 months ago

Try {{user.name}}. All properties from the event or user are flattened when processing so they are accessed on one layer. Should make this clearer in the docs and in the preview.

dark-matter08 commented 2 months ago

my user object does not directly have a name property but it does have full_name, first_name and last_name I tried {{user.full_name}} and still has the same issues

pushchris commented 2 months ago

Full name is a computed property on the user object that combines first name and last name together. It could be its overriding whatever value you are setting there. For now to see if you can get other any variable to come through, try accessing some other property on the user in the format {{user.property}}

pushchris commented 2 months ago

Closing this for now, if you are still having issues please feel free to re-open!