Learn how to use Novu to quickly send multi-channel (SMS, Email, Chat, Push) notifications with Ruby.
bundle install
.
index.rb
then initialize the client with your API token:
<NOVU_API_KEY>
argument with the authentic key from the API Key section of your Novu Dashboard.
index.rb
:
Channel | Providers |
---|---|
MailGun, Mandrill, MailJet, Amazon SES, Sendgrid, Postmark, Netcore | |
SMS | Twilio, Amazon SNS, Plivo, SMS, SMSCentral, Kannel, Infobip, Termii |
Chat | Mattermost, Slack, Microsoft Teams, Discord |
Push | FCM, APNS, Expo |
Channel | Content Style | Custom Variables{{handlebars}} format |
---|---|---|
HTML | ✅ | |
Visual Editor | ✅ | |
SMS | Text | ✅ |
Chat | Text | ✅ |
In-App | Text | ✅ |
Push | Text | ✅ |
Use the create workflow button to create a workflow
Rename the workflow to a more suitable title
Select Email as the channel you want to add, by dragging it from the right sidebar.
Add the fields in the email editor
Add the variables in the Variables section in the test tab
By default, the dashboard will display a subscriber, as you were added automatically during sign-up.
abc@gmail.com
is a random unlikely email your users will have. To update this to an alternative email, you can call the updateSubscriber
method like so:
phone
, avatar
, and data
. The data
field can accept an object of metadata that you want to attach to the subscriber.
name
should be the workflow’s trigger ID/slug.Make sure your workflow's trigger ID/slug matches the value you'd used
payload
is an array of the data that you want to be dynamically injected into the workflow content.subscriberId
is the id of the subscriber on Novu. Replace 7789
with your subscriber ID.key
, ensure it is unique and accurately identifies the topic. Document naming conventions and communicate them to team members to avoid confusion and ensure a smooth workflow.name
should be a descriptive topic name.to
field of the notification trigger.
To trigger a notification to all subscribers of a topic, copy and paste the code below:
name
key in the payload should be the name of the notification created earlier.