Reputation: 1519
I want to send a new registered user an email after filling the signup form. I'm using Django registration (1.0)
to handle the signup process. Also I used the simple-backend
so that user can get activated immediately after filling the signup form.
I wrote the below codes to send the new user a welcome email after signing up. From the docs the author said we should use the user_activated signals. But after implementing mine, it failed to send the user a welcome mail.
Signals.py
from registration.signals import user_activated
from django.dispatch import receiver
from django.core.mail import send_mail
@receiver(user_activated)
def my_notice(sender, user, request):
new_person=user.email
send_mail('Welcome On Board','Check the dashboard for more','[email protected]',[new_person,])
What am I missing?
Upvotes: 0
Views: 442
Reputation: 5249
File signals.py
is not read by django. Try in models.py
instead.
signals.py
file is a good place to define a signal. You're hooking up to one.
Upvotes: 1