mirror of
https://github.com/discourse/discourse.git
synced 2026-08-01 09:08:08 -05:00
When multiple replies are collapsed into a single notification, `PostAlerter` sets `display_username` to a translated reply count (e.g., "7 réponses") for use in the notification dropdown UI. The `original_username` field always holds the actual poster's username. However, if `original_username` is ever missing from the notification data, `notification_email` falls back to `display_username`, which causes the reply count string to be used as the email sender username. This leads to errors during email rendering. This updates the fallback chain in `notification_email` to prefer `post.user.username` over `display_username`, ensuring a real username is always used even when `original_username` is absent. https://meta.discourse.org/t//395420