mirror of
https://github.com/discourse/discourse.git
synced 2026-03-04 01:15:08 +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
|
||
|---|---|---|
| .. | ||
| authentication_results_spec.rb | ||
| cleaner_spec.rb | ||
| email_spec.rb | ||
| message_builder_spec.rb | ||
| processor_spec.rb | ||
| receiver_spec.rb | ||
| renderer_spec.rb | ||
| sender_spec.rb | ||
| styles_spec.rb | ||