[Fixed]-Django-allauth: send welcome email on signup (without verification)

26👍

No there is no such settings, but you can listen to a user_signed_up signal, which will have the user and request in parameters. Once it received send an email to the user.

Put the below code some where in models.py file:

from allauth.account.signals import user_signed_up
from django.dispatch import receiver

@receiver(user_signed_up, dispatch_uid="some.unique.string.id.for.allauth.user_signed_up")
def user_signed_up_(request, user, **kwargs):
    # user signed up now send email
    # send email part - do your self

7👍

allauth indeed only sends confirmation mails. But, it does differentiate between the first (signup) confirmation mail and following ones (e.g. when the user adds a second email address).

For this purpose allauth has a “email confirmation at signup”
template (account/email/email_confirmation_signup_message.txt, account/email/email_confirmation_signup_subject.txt).

When using the builtin templates this hybrid confirmation/signup/welcome mail is identical to the regular email confirmation template, but you can override it and put your welcome message in there. Furthermore, set ACCOUNT_EMAIL_VERIFICATION to "optional".

If all of this does not fit your needs, then you can hookup to the user_signed_up signal and send a plain welcome mail yourself.

Leave a comment