AnthonyCaterini
AnthonyCaterini

Reputation: 13

How do I send emails using django-simple-email-confirmation?

I have just started using django-simple-email-confirmation. They have an example of how to use it, which invokes a send_email method, as below:

email = '[email protected]'
user = User.objects.create_user(email, email=email)
user.is_confirmed # False

send_email(email, 'Use %s to confirm your email' % user.confirmation_key)
# User gets email, passes the confirmation_key back to your server 

I was wondering where this send_email method came from. I can't find it by searching the repo, besides when they use it in this example (which does not import anything). Everybody else seems to use the send_mail method in django, so I was wondering what exactly was going on here?

Thanks

Upvotes: 1

Views: 666

Answers (1)

Alasdair
Alasdair

Reputation: 309019

The send_email in the example looks like a typo. It looks to me as if they are using send_mail from Django. Try adding the following import:

from django.core.mail import send_mail

Then change the code in the example to use send_mail instead of send_email.

send_email(email, 'Use %s to confirm your email' % user.confirmation_key)

Upvotes: 1

Related Questions