Back
Product News
Apr 9, 2023
Sending multi-channel notifications from a Python app with a single API.
Anand Sukumaran
Python is a powerful programming language that has become a go-to choice for developing REST APIs and backend applications. Its clean and readable syntax, extensive libraries, and ease of use, makes Python a good choice to build and deploy web applications. In this blog, we'll learn how to use Engagespot python library to send multi-channel notifications like emails, push notifications, SMS, Whatsapp using a single function call. With this, You don't have to learn multiple provider APIs and integrate them into your code.
Prerequisites
Before getting started, make sure you have the API-KEY
and API-SECRET
for your Engagespot app. If you don't have, you can create one for free here. Also, you should enable the required channels from Engagespot dashboard -> Channels menu.
Using Engagespot Python library
Add the add engagespot library to your python project from pypi.
After that, you can simply import the Engagespot class in the module where you want to trigger notifications.
Initialize the Engagespot class with your API Key and API Secret that you'll find on your Engagespot dashboard.
Creating a user
Now, we should create a user in your Engagespot app. This function should be called whenever a new user is registered in your application.
This function creates the user Anand
identified by a unique identifier anand-001
. We'll also attach his email id to his user profile.
Sending a notification
Now you've created your user's profile in Engagespot. Now you can send a notification using the send
function.
Advanced Features
You can make use of advanced features like templated notifications, custom data attributes, file attachments etc by reading Engagespot documentation.