" (TEMPLATE_EXTENSION
defaults to "html", unset in this project) next to the .txt template it
already renders, and attaches it as the HTML alternative automatically --
no Python override needed, see allauth.account.adapter.render_mail.
Context comes from allauth.account.internal.flows.password_reset
.request_password_reset() plus DefaultAccountAdapter.send_mail: user,
password_reset_url, uid, key, request, current_site, email, and username
only when ACCOUNT_LOGIN_METHODS includes "username" (it doesn't here, see
rosterchief/settings.py -- login is email-only -- but the check is kept for
parity with the .txt template in case that ever changes).
render_to_string is called with the real `request`
(allauth.account.adapter.render_mail passes `context.request`), so this
picks up club.context_processors.branding like any other page: `club` is
set when the reset was requested on a club subdomain, None on the base
domain (e.g. a platform control-panel user). Both cases must render
something sensible -- a password reset is exactly the kind of email that
still has to work with no club in play.
{% endcomment %}
{% block title %}{% trans "Reset your password" %}{% endblock title %}
{% block preheader %}{% trans "Use this link to choose a new password. If you didn't request this, you can ignore this email." %}{% endblock preheader %}
{% block header %}
{% if club %}
{% absolute_media_url club.logo as logo_url %}
{% if club.logo %}
{% else %}
{% endif %}
|
{{ club.name }}
|
{% else %}
RosterChief
{% endif %}
{% endblock header %}
{% block content %}
{% trans "You're receiving this email because you or someone else has requested a password reset for your user account. It can be safely ignored if you did not request one." %}
{% trans "Reset your password" as reset_label %}
{% include "email/_button.html" with href=password_reset_url label=reset_label bg=club.primary_color|default:"#0ea5e9" fg=club.primary_color|default:"#0ea5e9"|contrast_color %}
{% if username %}
{% blocktrans %}In case you forgot, your username is {{ username }}.{% endblocktrans %}
{% endif %}
{% endblock content %}
{% block footer %}
{% if club %}
{% blocktrans with club=club.name %}Sent by {{ club }}, powered by RosterChief.{% endblocktrans %}
{% else %}
{% blocktrans with site_name=current_site.name %}Sent by {{ site_name }}.{% endblocktrans %}
{% endif %}
{% endblock footer %}