Richie
(Richie Rich)
12 september 2025 om 07:39
1
Wanneer een gebruiker wordt verwijderd door hun eerste bericht af te wijzen, ontvangen ze een e-mail met als onderwerp Uw account is verwijderd.
Er zit een bug in de body/inhoud van de e-mail, het lijkt erop dat er een soort Ruby hash-syntax wordt weergegeven in het middengedeelte van de e-mail:
Hallo,
Dit is een geautomatiseerd bericht van SITE NAME om u te laten weten dat het gebruikersaccount dat aan dit e-mailadres is gekoppeld, is verwijderd door een medewerker.
{:off_topic=>“Uw bericht is gemarkeerd als off-topic : de community vindt dat het niet goed past bij het onderwerp, zoals momenteel gedefinieerd door de titel en het eerste bericht.”, :inappropriate=>“Uw bericht is gemarkeerd als ongepast : de community vindt het aanstootgevend, beledigend, haatdragend gedrag of een schending van onze communityrichtlijnen.”, :illegal=>“Uw bericht is gemarkeerd als illegaal : de community denkt dat het mogelijk de wet overtreedt.”, :spam=>“Uw bericht is gemarkeerd als spam : de community vindt het een advertentie, iets dat overdreven promotioneel van aard is in plaats van nuttig of relevant voor het onderwerp zoals verwacht.”, :notify_moderators=>“Uw bericht is gemarkeerd voor moderatie : de community vindt dat er iets met het bericht is dat handmatige tussenkomst van een medewerker vereist.”, :responder=>{:off_topic=>“Het bericht is gemarkeerd als off-topic : de community vindt dat het niet goed past bij het onderwerp, zoals momenteel gedefinieerd door de titel en het eerste bericht.”, :inappropriate=>“Het bericht is gemarkeerd als ongepast : de community vindt het aanstootgevend, beledigend, haatdragend gedrag of een schending van onze communityrichtlijnen.”, :spam=>“Het bericht is gemarkeerd als spam : de community vindt het een advertentie, iets dat overdreven promotioneel van aard is in plaats van nuttig of relevant voor het onderwerp zoals verwacht.”, :notify_moderators=>“Het bericht is gemarkeerd voor moderatie : de community vindt dat er iets met het bericht is dat handmatige tussenkomst van een medewerker vereist.”}}
Bekijk onze communityrichtlijnen voor meer informatie.
Stappen om te repliceren:
Zorg ervoor dat Discourse vereist dat het eerste bericht van elke gebruiker wordt goedgekeurd
Maak een nieuwe gebruiker aan
Maak een nieuw bericht aan met de nieuwe gebruiker
Wijs, met een admin-account, het bericht af met de optie “Gebruiker verwijderen”
De nieuwe gebruiker ontvangt een e-mail met de bovenstaande inhoud
2 likes
Richie
(Richie Rich)
12 september 2025 om 07:41
2
If it helps, a couple of screen shots from the admin view of the rejected post:
Before deleting the user:
After rejection and deletion:
1 like
selase
(Selase Krakani)
Heeft dit topic gesplitst
18 november 2025 om 11:45
3
selase
(Selase Krakani)
12 september 2025 om 18:24
4
This looks like a bug in how flag_reason is generated here:
def account_deleted(email, reviewable)
post_action_type_id =
reviewable.reviewable_scores.first&.reviewable_score_type ||
PostActionTypeView.new.types[:spam]
build_email(
email,
template: "user_notifications.account_deleted",
flag_reason: I18n.t("flag_reasons.#{PostActionTypeView.new.types[post_action_type_id]}"),
)
end
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.
flag_reasons:
off_topic: "Your post was flagged as **off-topic**: the community feels it is not a good fit for the topic, as currently defined by the title and the first post."
inappropriate: "Your post was flagged as **inappropriate**: the community feels it is offensive, abusive, to be hateful conduct or a violation of [our community guidelines](%{base_path}/guidelines)."
illegal: "Your post was flagged as **illegal**: the community thinks it might be breaking the law."
spam: "Your post was flagged as **spam**: the community feels it is an advertisement, something that is overly promotional in nature instead of being useful or relevant to the topic as expected."
notify_moderators: "Your post was flagged **for moderator attention**: the community feels something about the post requires manual intervention by a staff member."
responder:
off_topic: "The post was flagged as **off-topic**: the community feels it is not a good fit for the topic, as currently defined by the title and the first post."
inappropriate: "The post was flagged as **inappropriate**: the community feels it is offensive, abusive, to be hateful conduct or a violation of [our community guidelines](%{base_path}/guidelines)."
spam: "The post was flagged as **spam**: the community feels it is an advertisement, something that is overly promotional in nature instead of being useful or relevant to the topic as expected."
notify_moderators: "The post was flagged **for moderator attention**: the community feels something about the post requires manual intervention by a staff member."
Relatedly, this likely impacts custom flags as well, since their translations would also be missing.
7 likes
Moin
12 september 2025 om 18:43
6
I am sure it does. I mentioned that in May
3 likes
selase
(Selase Krakani)
18 november 2025 om 11:51
7
We’ve merged a fix for the issue in the OP. I’ve moved the report related to staged users into its own topic to make it easier to track pending a fix.
main ← fix/deleted-user-email
opened 04:43PM - 24 Sep 25 UTC
`UserNotifications#account_deleted` builds a localized flag reason from the revi… ewable’s first `reviewable_score` (falling back to `spam` if none is found).
Currently, some score types (e.g. `needs_approval`) are not covered. In cases where a "Needs Approval" flag led to an account deletion, the lookup key could end up as `flag_reasons.`, causing the entire `flag_reasons`
section to be rendered instead of a single entry.
This change adds support for additional score types (like `needs_approval`). If no translation exists (e.g. custom flags), the flag’s description will be used if available, before falling back to the default `spam` reason.
More context: https://meta.discourse.org/t/ruby-hash-syntax-being-displayed-in-emails-sent-to-deleted-users/382411
1 like