# Ruby hash syntax being displayed in emails sent to deleted users

**URL:** https://meta.discourse.org/t/ruby-hash-syntax-being-displayed-in-emails-sent-to-deleted-users/382411
**Category:** Bug
**Tags:** email, review-queue, fixed
**Created:** [September 12, 2025, 7:39am UTC](https://meta.discourse.org/t/ruby-hash-syntax-being-displayed-in-emails-sent-to-deleted-users/382411 "2025-09-12T07:39:51Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![selase](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/selase/32/270909_2.png) [@selase](https://meta.discourse.org/u/selase)
#### Post date: [September 12, 2025, 6:24pm UTC](https://meta.discourse.org/t/ruby-hash-syntax-being-displayed-in-emails-sent-to-deleted-users/382411/4 "2025-09-12T18:24:44Z")

</div>

This looks like a bug in how `flag_reason` is generated here:

> <https://github.com/discourse/discourse/blob/1aa055cee202d3045594eaf6f14b3742b0e71d34/app/mailers/user_notifications.rb#L181-L190>

`PostActionTypeView.new.types` doesn’t include `:needs_approval` flag (which gets created in the flow described). Because of this, the translation key resolves to `flag_reasons.` (with no suffix), which returns the entire YAML section instead of a single entry. That’s why there is a Ruby hash in place of the flag reason.

> <https://github.com/discourse/discourse/blob/1aa055cee202d3045594eaf6f14b3742b0e71d34/config/locales/server.en.yml#L3365-L3375>

Relatedly, this likely impacts custom flags as well, since their translations would also be missing.

---

_[View the full topic](https://meta.discourse.org/t/ruby-hash-syntax-being-displayed-in-emails-sent-to-deleted-users/382411)._
