Skip to main content

How to send a notification

In order to use the notifications you need to call it via hooks, and you can notify (send notification) depends on your criteria, by users, roles, or all users. To use it you need to follow these steps:
Parameters:
  1. rolesTo (string): use it to send notifications to specific roles. To send multiple split by comma
  2. usersTo (string): use it to send notifications to specific users. To send multiple split by comma
  3. message (string): use it to send a message in the notification
  4. title (string): use it to send a title in the notification
  5. action (string): use it to send the feature you want to navigate
  6. messageType (string): success | info | error | warning;

How to send to multiple users

To send a notification to multiple users, you can send it with the email of the user already registered in the app or the Id of the user in the database, everything separated by commas to add multiple users, also you can combine the Id of the user and/or emails. Use the parameter usersTo.

How to send to multiple roles

To send a notification to multiple roles add the parameter usersTo and put the roleId and/or rolesId you want to send notifications, it will send a notification to every user with the Role sent in. To send it to multiple roles add them separated by commas.

Hot to send to multiple roles and users

To send the notification to specific users and/or roles you can combine them just using the both parameters (rolesTo and usersTo).

How to send to all users

If you want to send a notification to all users in the app, do not use the parameters rolesTo and usersTo, to tell the app that need to send it to all users.
To send a notification that allows navigate to another feature you have to add the action parameter with the URL of the feature you want to go.
Also you can use the context of the UI application, To do that you need to send parameters