Discussion:
Send E-mail to User When Account is Activated though Django Admin Application
Asad Habib
2018-11-19 18:26:56 UTC
Permalink
Is there a way to send an e-mail to a user when their account is activated
through the Django admin application? I can do it independently of the
Django admin application but I want the admin to be signed in before they
activate a user. Is there a way to achieve this without customizing the
Django admin application code? Thanks in advance.
--
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 post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8a42e9b3-de26-44a5-ab1c-cd6431fd363c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
l***@gmail.com
2018-11-19 22:07:20 UTC
Permalink
I've done this recently by importing smtplib into my views.py file, and
made executing a mail send a result of a view.

I didn't realize at the time, but there is Django specific tools for this
as well.

https://docs.djangoproject.com/en/2.1/topics/email/
Post by Asad Habib
Is there a way to send an e-mail to a user when their account is activated
through the Django admin application? I can do it independently of the
Django admin application but I want the admin to be signed in before they
activate a user. Is there a way to achieve this without customizing the
Django admin application code? Thanks in advance.
--
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 post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ae93581b-a0f9-4eda-91bc-4ec765adcc75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yavin Aalto Arba
2018-11-20 10:11:33 UTC
Permalink
I would also recommend checking out using Signals instead of directly from
the view:
https://docs.djangoproject.com/en/2.1/topics/signals/

You can then write a a function that will send an email based on the event.
The sending email documentation is superb:
https://docs.djangoproject.com/en/2.1/topics/email/
Post by l***@gmail.com
I've done this recently by importing smtplib into my views.py file, and
made executing a mail send a result of a view.
I didn't realize at the time, but there is Django specific tools for this
as well.
https://docs.djangoproject.com/en/2.1/topics/email/
Post by Asad Habib
Is there a way to send an e-mail to a user when their account is
activated through the Django admin application? I can do it independently
of the Django admin application but I want the admin to be signed in before
they activate a user. Is there a way to achieve this without customizing
the Django admin application code? Thanks in advance.
--
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
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/ae93581b-a0f9-4eda-91bc-4ec765adcc75%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/ae93581b-a0f9-4eda-91bc-4ec765adcc75%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B%2Be-ZXpkKvOxcVGYxW%3D3aJf%3DacLe9UM8zXGXvtYRV%3DFYmrvHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...