django-allauth:电子邮件确认

时间:2016-03-16 15:27:02

标签: python django django-allauth

我设置django-allauth并在新用户注册时使用电子邮件确认工作正常

但在确认电子邮件中,我

Hello from example.com!

    You're receiving this e-mail because user abc13 at example.com has given yours as an e-mail address to connect their account.

    To confirm this is correct, go to http://<mysite>.com/accounts/confirm-email/q3rknxpflshgwddlbjw6aqzlr1ayqtnfrtezucoq2ysmfbm2etcldusq5dyrcoap/

    Thank you from example.com!
    example.com

我如何更换&#34; example.com&#34;用我的网站名称?

感谢

2 个答案:

答案 0 :(得分:3)

听起来您需要更新Django管理员中的Site条目。您可以访问:

http://<yoursite>.com/admin/sites/site/

答案 1 :(得分:1)

您还可以使用以下内容创建完全自定义的电子邮件:

@receiver(user_signed_up)
def user_signed_up_(sender,request,user,**kwargs):

    subject, from_email, to = 'Welcome', 'admin@mysite', 'person@somewhere'
    text_content ="some custom text or html"
    msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
    msg.attach_alternative(html_content, "text/html")
    msg.send()
相关问题