Richie
(Richie Rich)
12. September 2025 um 07:39
1
When a user is deleted by rejecting their first post, they are sent an email with the subject line of Your account has been deleted
.
There is a bug in the body / content of the email, it appears to be displaying some kind of Ruby hash syntax in the middle section of the email:
Hello,
This is an automated message from SITE NAME to let you know that the user account associated with this email address has been deleted by a staff member.
{: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 .”, :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 .”, :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.”}}
Please review our community guidelines for details.
Here’s a screen shot of the email the user receives, showing the formatting:
Steps to replicate:
Ensure Discourse requires the first post of every user to be approved
Create a new user
Create a new post with the new user
Using an admin account, reject the post with the “Delete user” option
New user is sent an email with the above content
1 „Gefällt mir“
Richie
(Richie Rich)
12. September 2025 um 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 „Gefällt mir“
Moin
12. September 2025 um 08:08
3
It happened on my site too. I think the email doesn’t work when the post wasn’t added to the review queue because of a flag, but because it requires aporoval.
I first noticed when I was testing the Approve unless staged
site setting and deleted the user when the post arrived and required approval. This was even more confusing as the user doesn’t really have an account. They only used email in.
I would be grateful if, in addition to the fix for non-flag reviewables such as post approval, a different handling method could also be found for staged users, who do not actually have an account.
(Similarly, I would still be grateful if the email were only sent once deletion was successful , if custom flag reasons worked , and if forums where the guidelines are not public did not refer to them in the email )
3 „Gefällt mir“
selase
(Selase Krakani)
12. September 2025 um 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.
5 „Gefällt mir“
Moin
12. September 2025 um 18:43
6
I am sure it does. I mentioned that in May
3 „Gefällt mir“