Django mail

33 views
Skip to first unread message

mick

unread,
Mar 22, 2020, 5:19:42 AM3/22/20
to Django users
I am using django rest auth I want to fire a mail to the user if the user hasn't verified in one day after sign up automatically.
How to do ?

Kasper Laudrup

unread,
Mar 22, 2020, 5:45:35 AM3/22/20
to django...@googlegroups.com
Hi Mick,
https://docs.djangoproject.com/en/3.0/topics/email/

Kind regards,

Kasper Laudrup

DHRUVA

unread,
Mar 22, 2020, 6:03:19 AM3/22/20
to django...@googlegroups.com
Thanks
But how to do scheduling of the mails automatically on the basis of the events.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/785e74e9-8df0-017a-31e8-62305427190e%40stacktrace.dk.

Kasper Laudrup

unread,
Mar 22, 2020, 6:54:14 AM3/22/20
to django...@googlegroups.com
Hi Mike,

On 22/03/2020 11.01, DHRUVA wrote:
> Thanks
> But how to do scheduling of the mails automatically on the basis of the
> events.
>

You might be able to handle this with Django signals:

https://docs.djangoproject.com/en/3.0/topics/signals/

But since you've mentioned you want events to be triggered based on some
timer, you should probably look into Celery integration:

https://docs.celeryproject.org/en/latest/django/first-steps-with-django.html

I don't have any personal experience with Celery, but I'm sure others
here do and will be happy to help you with any issues you might have.

Kind regards,

Kasper Laudrup

DHRUVA

unread,
Mar 22, 2020, 7:03:18 AM3/22/20
to django...@googlegroups.com
Hey thanks 

The events would be like if they haven't verified their profile after signup then in 24 hours still not done after 3 days.So then the same with the profile build up if they have filled half then a Mail to complete.

Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

Antje Kazimiers

unread,
Mar 22, 2020, 7:46:22 AM3/22/20
to django...@googlegroups.com, DHRUVA

Couldn't you also set up cron jobs to check for some conditions you have to come up with, which are using the fields of your User model like date_joined and check, if fields of your user profile are filled in with respect to the created date of your profile?

I would start with writing some django commands to query those conditions and send out the email using django send_mail. Those commands you could then schedule with cron jobs.

https://docs.djangoproject.com/en/3.0/howto/custom-management-commands/
https://docs.djangoproject.com/en/3.0/topics/email/

Antje

Reply all
Reply to author
Forward
0 new messages