Rajas Bondale
Rajas Bondale

Reputation: 39

Is there any way to send mails regulary using Sendgrid?

I want to send monthly notifications to users that log on to my website. I've thought of using Sendgrid's Marketing campaigns to send monthly mails but it doesn't fit perfectly to my needs. I'll have to keep adding emails to the automation at a month's duration and that doesn't seem the right way to do it.

Upvotes: 0

Views: 155

Answers (1)

user16350436
user16350436

Reputation:

Use Celery.

from celery.schedules import crontab


def setup_periodic_tasks(app):
    app.conf.beat_schedule = {
        'monthly-email': {
            'task': '[APP NAME].tasks.[FUNCTION NAME]',
            'schedule':
        },

https://docs.celeryproject.org/en/stable/userguide/periodic-tasks.html#crontab-schedules

Upvotes: 1

Related Questions