main ← fix/email-notification-display-username-fallback
opened 08:01AM - 10 Feb 26 UTC
When multiple replies are collapsed into a single notification, `PostAlerter` se…ts `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