July 7 - Update invitation with Brand Name, based on hostname
This commit is contained in:
@@ -188,12 +188,13 @@ def _send_invite_email(user, token, base_url=None):
|
||||
effective_base = (base_url or current_app.config.get('APP_BASE_URL', '')).rstrip('/')
|
||||
setup_link = f'{effective_base}{url_for("customers.set_password", token=token)}'
|
||||
|
||||
# From MUST be the authenticated SMTP identity (MAIL_DEFAULT_SENDER); a
|
||||
# per-host noreply@<domain> is accepted by the relay but dropped downstream
|
||||
# by SPF/DMARC. The per-domain host is still preserved in setup_link above.
|
||||
sender = (current_app.config.get('MAIL_DEFAULT_SENDER')
|
||||
or current_app.config.get('MAIL_USERNAME')
|
||||
or 'noreply@janitorialqc.local')
|
||||
# Per-domain branded From as a (display_name, address) tuple. The display
|
||||
# NAME always tracks the host (e.g. "Gov Services QC"); the ADDRESS is
|
||||
# branded only for DNS-authorized domains and otherwise stays the
|
||||
# authenticated identity so the mail always delivers. See
|
||||
# app/utils/mail_utils.py and CLAUDE.md rule 64.
|
||||
from app.utils.mail_utils import branded_sender
|
||||
sender = branded_sender(effective_base)
|
||||
|
||||
html_body = render_template_string("""<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
Reference in New Issue
Block a user