parcelvoy / platform

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

Q: Why does user_created contain `data` and other events do not? #460

Closed mattes3 closed 3 months ago

mattes3 commented 3 months ago

I noticed that the user_created event has a data field that is an object that contains the user data.

However, when I send any other event, using POST /client/events, the resulting event in the user details view has no data field, although I passed it. The data is merged into the other fields of the event, instead.

Is this a coincidence, or is it by design?

pushchris commented 3 months ago

It's passed in a copy of the user object so the structure is mimicking how events and users store the majority of their keys under data. We kinda obfuscate that that is happening in most of the UI since its not something the user should need to care about (they should just be able to assume that all properties exist at the same level). In that vein I think it would probably make sense to expand the data object on the user

mattes3 commented 3 months ago

The reason why I am asking is that I have problems to correctly trigger on events.

I want to create an entrance in a journey that triggers on a field inside the event. It looks like on all events except user_created I have to write $.field. On user_created I have to write $.data.field.

pushchris commented 3 months ago

This should be resolved in the next release 👍🏻