mailer: send account emails as "asxp.io admin"
All checks were successful
Build and Deploy to Production / test (push) Successful in 25s
Build and Deploy to Production / build (push) Successful in 1m1s
Build and Deploy to Production / deploy (push) Successful in 38s

Invite and reset mails reused MAIL_FROM, whose display name is still
"IE Sergei Poljanski Contact Form" from the removed contact form. Keep
its verified address but use "asxp.io admin" as the name (overridable
with ADMIN_MAIL_NAME).

Assisted-by: Claude:opus-5
This commit is contained in:
Sergei Poljanski 2026-10-10 08:50:30 +04:00
commit 12d29dec0c
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
2 changed files with 11 additions and 1 deletions

View file

@ -71,8 +71,16 @@ module Mailer
end
# Invite / password-reset email with a one-time link.
# Account mail keeps MAIL_FROM's verified address but not its display name
# ("… Contact Form"); ADMIN_MAIL_NAME overrides the default.
def admin_from
addr = Mail::Address.new(ENV.fetch('MAIL_FROM'))
addr.display_name = ENV.fetch('ADMIN_MAIL_NAME', 'asxp.io admin')
addr.format
end
def account_link(to:, username:, url:, kind:)
from = ENV.fetch('MAIL_FROM')
from = admin_from
subj, intro, ttl =
if kind == 'invite'
['Your asxp.io admin account', "An account \"#{username}\" was created for you on the asxp.io admin.\nSet your password here:", '48 hours']