iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.65k stars 306 forks source link

How to override verification email #175

Open rojeda24 opened 3 years ago

rojeda24 commented 3 years ago

I want to send a customized verification email. I find no documentation about how to do this.

We want to translate from English to Spanish. Please, help with some indications!

sazzeb commented 3 years ago

Hi the method to override the default email is very simple

dj_rest_auth users default alluath, so to override you have to add this to file in your django templates

templates

ensure you have email_confirmation_message.html email_confirmation_signup_message.html

sazzeb commented 3 years ago

you can take sample code for email_confirmation_message.html

`

{% load account %} {% user_display user as user_display %} {% load i18n %} {% autoescape off %}
Investor Application

E-mail Confirmation

Hey {{ user_display }},

It looks like you just signed up for The App, that’s awesome! Can we ask you for email confirmation? Just click the button bellow.

CONFIRM EMAIL ADDRESS

Keep Rockin'!
Your The App team

{% endautoescape %}

`

sazzeb commented 3 years ago

for email_confirmation_signup_message.html

{% include "account/email/email_confirmation_message.html" %}

you can read the documentation for more clarification Sending Email

roberthobblebottom commented 2 years ago

@sazzeb I have very similar folder structure as yours but im still using the default email template. Am I suppose to override VerifyEmailView?

My url.py path: path('dj-rest-auth/account-confirm-email/', VerifyEmailView.as_view(), name='account_email_verification_sent')

quyenhair2109 commented 2 years ago

Hi the method to override the default email is very simple

dj_rest_auth users default alluath, so to override you have to add this to file in your django templates

templates

ensure you have email_confirmation_message.html email_confirmation_signup_message.html

I fixed my problem, thanks a lot

itsapkota commented 1 year ago

I want to customise the view so that email can be sent asynchronously. can anybody help me on this.I am using it in rest framework. Thank you

Kellen-Stuart commented 5 months ago

@sazzeb Your link to the documentation is returning a 404.