mirror of
https://github.com/discourse/discourse.git
synced 2026-03-03 22:05:52 +08:00
Admins customizing email templates had no way to reference the username
of the person receiving the email. The existing `%{username}` key refers
to the post author, not the recipient.
Pass the recipient user object through `build_email` via a new
`recipient_user` option across all mailer paths (notifications, account
emails, digest, token-based emails). `Email::MessageBuilder` then
extracts `recipient_username` into template args when present. The key
is also added to `ALLOWED_CUSTOM_INTERPOLATION_KEYS` so it appears in
the admin email template editor and passes validation.
Not available for invite emails since the recipient has no account yet.
Ref - t/172375
|
||
|---|---|---|
| .. | ||
| group_smtp_mailer_spec.rb | ||
| invite_mailer_spec.rb | ||
| rejection_mailer_spec.rb | ||
| subscription_mailer_spec.rb | ||
| test_mailer_spec.rb | ||
| user_notifications_spec.rb | ||
| version_mailer_spec.rb | ||