novuhq / novu

Open-Source Notification Platform. Embeddable Notification Center, E-mail, Push and Slack Integrations.
https://novu.co
Other
34.5k stars 3.52k forks source link

[NV-1745] 🐛 Bug Report: Use more fields of user in identify service #2869

Open ali-master opened 1 year ago

ali-master commented 1 year ago

📜 Description

It seems we can add more fields about users in Novu DB while identifying as I can see in TS ISubscriberPayload interface.

export interface ISubscriberPayload {
    firstName?: string;
    lastName?: string;
    email?: string;
    phone?: string;
    avatar?: string;
    locale?: string;
    [key: string]: string | string[] | boolean | number | undefined;
}

But it doesn't work as well as expected and just reserved fields would be inserted. When I retrieve the User in Novu, the custom fields don't retrieve. for example, we want to use some device information in identifying services such as these props:

You may be asking me why? I'll tell you, assume that I want to send a promotion push to every android device by manufacturer or send a birthday message push to every user that their birthday is on x day. so How can I do this? I used the Novu to manage all these things, not just the system that manages multi providers. Every Marketing team needs this critical feature to communicate or engage more and more with their users.

👟 Reproduction steps

Try to use custom fields in identify SDK method.

👍 Expected behavior

All custom fields should be added to Novu DB and should be visible in Admin Panel and retrievable by getUser SDK's method.

👎 Actual Behavior with Screenshots

Screenshot from 2023-02-20 22-46-32

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

Yes I am willing to submit a PR!

NV-1745

scopsy commented 1 year ago

@ali-master seems like the TS definition is wrong :( Could you try updating the the subscriber and passing all custom metata inside data object? https://docs.novu.co/api/create-subscriber/

We will need to update the TS definition so it will have a data object:

 data: {    [key: string]: string | string[] | boolean | number | undefined; }

Will you want to help with this?

ali-master commented 1 year ago

@ali-master seems like the TS definition is wrong :( Could you try updating the the subscriber and passing all custom metata inside data object? https://docs.novu.co/api/create-subscriber/

We will need to update the TS definition so it will have a data object:

 data: {    [key: string]: string | string[] | boolean | number | undefined; }

Will you want to help with this?

Can we send a push to everyone who matches their data prop to some conditions? For example I want to send an update push to everyone who matches these conditions as below:

{
    isAndroid: true,
    appVersion: "1.12.3" 
}
scopsy commented 1 year ago

@ali-master unfortunately, not at the moment. This could potentially be possible with the broadcast endpoint, but we lack filters there at the moment. Could you open a new issue for this:?

ali-master commented 1 year ago

@ali-master unfortunately, not at the moment. This could potentially be possible with the broadcast endpoint, but we lack filters there at the moment. Could you open a new issue for this:?

Of course, I'll create a new one.

oba2311 commented 1 year ago

@scopsy if a new issue will be opened - can we close this one?

scopsy commented 1 year ago

Let's first open one so we can link between the two 🙏

oba2311 commented 1 year ago

@ali-master wanted to make sure you still interested in working on this and opening the ticket. thanks