Closed getup8 closed 11 months ago
That wouldn't be to difficult of a PR for someone to make, you already have access to emailconfirmation.email_address
. I would pass the full object in case someone also wants to check its verified or primary -ness then just use something like email.email
for the actual email address depending on ctx key used.
Yeah right now I'm actually just doing this since email is already passed into render_mail(...)
def render_mail(self, template_prefix, email, context):
"""
Override so we can inject the email address itself into the context.
Opened a bug for this:
https://github.com/pennersr/django-allauth/issues/2647
"""
# Add email address to context.
context['email_address'] = email
return super(CustomAccountAdapter, self).render_mail(
template_prefix, email, context)
Agree, it would likely be a small PR. I am not adept at contributing but will try to take a look this week.
I am not adept at contributing but will try to take a look this week.
@getup8
Seems the relevant issues this user linked are closed, maybe this is fixed already? If not it's a good small thing to do.
Closed via a778398e
I'm curious why the email address itself (that the email is sent to) isn't sent in the context to the template, e.g.
https://github.com/pennersr/django-allauth/blob/e49df55815e13a3e59e51fc9e4764f3af2a035d0/allauth/account/adapter.py#L444-L449
In the case where people use specific versions of their emails to sign up (e.g. myname+suffix@gmail.com) or have their emails forwarded from elsewhere, I think it's nice to actually display the email address that's being confirmed in the email itself.
Let me know your thoughts!
Somewhat related to #2516 and #2186