Quick Setup
The easiest way to get started with Engagespot is to create an account on our managed SaaS portal. You can also self host the community edition of Engagespot on your local-machine by following this guide.
1. Creating your users
Engagespot needs to know your app's users to send notifications to them. You can read more about this here. You can create users via two methods.
- Using the In-App Inbox component (if you plan to use it).
- Using our backend SDKs or REST APIs.
- If you're using an integration such as Bubble, read the corresponding doc to learn how to create users.
If you integrate the Engagespot in-app inbox widget in your app, users will be automatically created (unless you have secure mode turned on in Engagespot console)
Every user will have a unique identifier known to your backend.
2. Enabling providers
As you might have read in the basic concepts chapter, there should be providers to enable notification delivery over a specific channel. Login to Engagespot console, navigate to Channels, and enable the default providers in In-App and Email channels.
3. Setting up In-App Inbox
If you're planning to setup an inbox component in your front-end app, follow this guide. Otherwise, we'll just test the email notifications for now.
4. Create a notification template
The best way to send notifications via Engagespot is by creating notification templates. A notification template specifies how a specific information should be sent to your users. For example, you can create a "New transaction alert" template, and create it's content for channels like In-App, Email, SMS etc.
To learn how to create templates, read this guide.
5. Trigger the templated notification from your backend
Notifications are usually triggered from your app's backend, when some event occurs. For example, in this case when a transaction happens on your backend, you can trigger an Engagespot notification.
If you're using Bubble plugin, read this guide to learn how to trigger notifications
You can also trigger notifications using a client library of your choice such as Node.js, PHP, or even HTTP API.
- Node
- cURL
- Python
- PHP
import { EngagespotClient } from '@engagespot/node';
const client = EngagespotClient({
apiKey: 'ENGAGESPOT_API_KEY',
apiSecret: 'ENGAGESPOT_API_SECRET',
});
client.send({
notification: {
templateId: '<template_id>',
},
recipients: ['<recipient_unique_id>'],
});
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": {
"templateId": "<template_id>"
},
"recipients": [
"unique-user-identifier"
]
}'
import requests
import json
url = "https://api.engagespot.co/v3/notifications"
payload = json.dumps({
"notification": {
"templateId": "<template_id>"
},
"recipients": [
"unique-user-identifier"
]
})
headers = {
'X-ENGAGESPOT-API-KEY': 'YOUR_ENGAGESPOT_API_KEY',
'X-ENGAGESPOT-API-SECRET': 'YOUR_ENGAGESPOT_API_SECRET',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
use Engagespot\EngagespotClient;
$config = [
'apiKey' => 'your-api-key',
'apiSecret' => 'your-api-secret',
];
// Create an instance of EngagespotClient
$engagespot = new EngagespotClient($config);
$notificationData = [
'notification' => [
'templateIdentifier' => 'sampleTemplate',
],
'sendTo' => [
'recipients' => ['user1', 'user2'],
]
];
$response = $engagespot->send($notificationData);
Done 🎉. Within few seconds you can see the messages arriving to that user's email, and in-app inbox (if you've set it up)
Advanced setup
Now you've learned to trigger templates. That's the simplest way to use Engagespot. Now you can learn more advanced concepts in the upcoming lessons.