What I want to do is to override confirmation email url in templates/account/email/email_confirmation_message.txt
.
I want to change this part
To confirm this is correct, go to {{ activate_url }}
to something like
http://localhost:8080/confirm_email/{{ key }}
However, I couldn't figure out where {{ activate_url }}
comes from.
I want to send the key
to the endpoint made by rest-auth
.
How can I rewrite the url link on email? Or if it's too complitcated, what is the easy way to verify the email on frontend?
activate_url
is the url containing the confirmation token that allows allauth to verify this is associated with the correct email. What'skey
? – Kaurikey
is what is needed to verify email. Please see the source code. I'm usingDjango
as rest API. So I don't wanna use the defaulturl
. The part of{{ activate_url }}
iskey
– Marinekey
is also a context variable passed to the template. Just write your own template. – Kauriemail_confirmation_message.txt
doesn't refer to thekey
. The part of{{ activate_url }}
iskey
– Marinesend_confirmation_mail()
method in allauth/account/adapter.py. This allows you to add in your template something like "if the above link doesn't work, go tomysite.com/confirm-email
and insert this key there", presenting an extra form where they can paste the key. – Kauriviews.py
.. Honestly I still don't get how thisadapter
is used.. Thanks I think I can solve the problem now. – Marineadapter.py
the template is referred asemail_template = 'account/email/email_confirmation'
but there is not this template. Whereemail_confirmation_message.txt
is used? – Marineemail_confirmation
, it usesemail_confirmation_message.txt
andemail_confirmation_message.html
for the body andemail_confirmation_subject.txt
for the subject. It automatically sends a multipart message if the.html
template is present, otherwise it only sends the text message. This is done in therender_mail
method – Kauri