kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
docs: update Novu instructions
rodzic
a89a3ec4bf
commit
32e971f4a2
24
docs/novu.md
24
docs/novu.md
|
@ -28,8 +28,6 @@ Otherwise, you can pass it in as an argument to the `Novu` constructor.
|
|||
|
||||

|
||||
|
||||
[novu]: https://novu.co/
|
||||
|
||||
### Create a Notification Template
|
||||
|
||||
For each notification type you want to send, you need to create a template in Novu. This is a one-time setup step that you can do on the Novu web interface.
|
||||
|
@ -55,7 +53,7 @@ To create a template, follow these steps:
|
|||
|
||||

|
||||
|
||||
4. Double-click the "notification name" field and enter the name of the template. This is the event name with which the respective notification may be triggered from the API.
|
||||
4. Double-click the "notification name" field and enter the name of the template. For this example, we choose the name `send-sms`. This is the event name with which the respective notification may be triggered from the API.
|
||||
|
||||

|
||||
|
||||
|
@ -66,3 +64,23 @@ To create a template, follow these steps:
|
|||
6. Click inside the "SMS message content" text field on the right and enter the content of your SMS, e.g. a handlebars placeholder such as `{{content}}`.
|
||||
|
||||

|
||||
|
||||
7. When you're done, click "Update" on the top-right. You are now ready to send SMS notifications via the API. For example, to manually trigger a notification via the Agentic Novu Service client:
|
||||
|
||||
```ts
|
||||
import { NovuClient } from '@agentic/core'
|
||||
|
||||
const client = new NovuClient()
|
||||
|
||||
client.triggerEvent('send-sms', { content: 'Hello World!' }, [{
|
||||
subscriberId: '1',
|
||||
name: 'Jane Doe',
|
||||
email: 'jane.doe-123@hotmail.com'
|
||||
phone: '+11234567890'
|
||||
}])
|
||||
```
|
||||
|
||||
The `subscriberId` is a required field with the ID of the subscriber in Novu. If a subscriber with a provided `subscriberId` does not exist yet in Novu, a new subscriber will be created before the trigger will be executed synchronously. You can find more information about subscribers [in the official Novu documentation][novu-subscribers].
|
||||
|
||||
[novu]: https://novu.co/
|
||||
[novu-subscribers]: https://docs.novu.co/platform/subscribers
|
||||
|
|
Ładowanie…
Reference in New Issue