Skip to content

Implement NotificationSender and scheduled job script

Igor Jakovljevic requested to merge ijakovlj/notifications-samples:master into master

[Feature] Scheduled Notifications Script

This commit adds new features to the codebase that allow sending notifications and scheduling them to be sent at specific times. The NotificationSender class is responsible for sending notifications to a specific channel using the requests library. The ScheduledJob class is responsible for scheduling notifications to be sent at specific times using the schedule library.

The NotificationSender class takes in a number of configuration parameters from environment variables, including the channel ID, API endpoint, bearer token, notification title, and priority. These parameters are used to construct a message payload that is sent to the remote server using a POST request. The ScheduledJob class allows for notifications to be scheduled at specific times using a variety of scheduling options provided by the schedule library.

This commit also includes tests for the NotificationSender class, ensuring it functions correctly and can be integrated with other parts of the codebase. Finally, this commit includes documentation for both classes, including examples of how to use them in different scenarios.

Merge request reports