From 6fc224145910844c9f7d5abfb1f8914512e6ac0b Mon Sep 17 00:00:00 2001 From: Hugo bessa Date: Fri, 20 Dec 2024 18:06:02 -0300 Subject: [PATCH] Add documentation on scheduled notifications --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ab5d2e4..c368712 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,13 @@ notifications_service.create_notification( ) ``` +### Scheduled notifications + +VintaSend schedules notifications by creating them on the database for sending when the `send_after` value has passed. The sending isn't done automatically but we have a service method called `send_pending_notifications` to send all pending notifications found in the database. + +You need to call the `send_pending_notifications` service method in a cron job or a tool like Celery Beat. + + ## Glossary * **Notification Backend**: It is a class that implements the methods necessary for VintaSend services to create, update, and retrieve Notifications from da database.