Quick Setup
We'll learn how to send notifications to your users in 5 simple steps.
1. Enable providers
Providers are third party services like Twilio, Sendgrid etc that are required for delivering messages as you you might have read in the basic concepts chapter. Login to Engagespot console, navigate to Channels, and enable required providers.
By default, we have enabled default providers for InApp
, Email
and SMS
channels. That means, you can test these channels without connecting a third party provider.
2. Install In-App Inbox component
If you don't want to enable the In-App channel, you can skip this step.
If you enable the In-App channel, you should setup the inbox component in your front-end app. Follow this guide.
3. Create a workflow
The best way to send notifications via Engagespot is by creating workflows. Workflows allow you to define a series of steps or actions that will be executed automatically based on specific triggers or conditions.
To learn how to create workflows, read this guide.
4. Trigger the workflow from your backend
After creating the workflow, you can trigger it from your app's backend using a client library of your choice such as Node.js, PHP, or even our REST API.
- Node
- cURL
- PHP
const { EngagespotClient } = require('@engagespot/node');
const client = EngagespotClient({
apiKey: 'YOUR_ENGAGESPOT_API_KEY',
apiSecret: 'YOUR_ENGAGESPOT_API_SECRET',
});
client.send({
notification: {
workflow: {
identifier: 'welcomeMessage',
},
},
sendTo: {
recipients: [
{
identifier: 'johndoe001',
email: 'johndoe001@gmail.com',
phoneNumber: '+16020000000',
},
],
},
});
curl --location --request POST 'https://api.engagespot.co/v3/notifications' \
--header 'X-ENGAGESPOT-API-KEY: YOUR_ENGAGESPOT_API_KEY' \
--header 'X-ENGAGESPOT-API-SECRET: YOUR_ENGAGESPOT_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
"notification": {
"workflow": {
"identifier": "<workflowIdentifier>"
},
"sendTo": {
"recipients": [{
"identifier":"johndoe001",
"email": "johndoe001@gmail.com",
"phoneNumber": "+16020000000",
}]
}
}
}'
use Engagespot\\EngagespotClient;
$engagespot = new EngagespotClient('ENGAGESPOT_API_KEY', 'ENGAGESPOT_SECRET_KEY');
$notificationData = [
'notification' => [
'workflow' => [
'identifier' =>'welcomeMessage'
],
],
'sendTo' => [
'recipients' => [
'identifier': 'johndoe001',
'email': 'johndoe001@gmail.com',
'phoneNumber': '+16020000000',
],
],
];
$response = $engagespot->send($notificationData);
- In the above example, we identify the users (recipients) inline. You can also create these users before triggering the worklow, so you can use the unique identifier instead of including the entire profile information in every trigger.
- If you're using Bubble plugin, read this guide to learn how to trigger workflows from Bubble.
- Check the Logs section in Engagespot Console to debug any delivery issues.
Advanced setup
Hurray! 🎉. You just learned how to send messages to your users! Now you can learn more advanced concepts in the upcoming lessons.