Richie
(Richie Rich)
9월 12, 2025, 7:39오전
1
사용자가 첫 게시물을 거부(reject)하여 삭제된 경우, Your account has been deleted이라는 제목의 이메일이 전송됩니다.
이메일 본문/콘텐츠에 버그가 있으며, 이메일 중간 부분에 Ruby 해시(hash) 문법이 표시되는 것으로 보입니다:
안녕하세요,
이것은 SITE NAME 에서 보낸 자동화된 메시지입니다. 이 이메일 주소와 연결된 사용자 계원이 스태프에 의해 삭제되었음을 알려드립니다.
{:off_topic=>“게시물이 **오프톱(off-topic)**으로 플래그되었습니다: 커뮤니티는 현재 제목과 첫 게시물로 정의된 주제와 잘 맞지 않는다고 생각합니다.”, :inappropriate=>“게시물이 **부적절(inappropriate)**로 플래그되었습니다: 커뮤니티는 이 게시물이 offensive, 악의적, 증오 발언 또는 커뮤니티 가이드라인 위반이라고 생각합니다.”, :illegal=>“게시물이 **불법(illegal)**으로 플래그되었습니다: 커뮤니티는 이 게시물이 법을 위반하고 있을 수 있다고 생각합니다.”, :spam=>“게시물이 **스팸(spam)**으로 플래그되었습니다: 커뮤니티는 이 게시물이 주제에 유용하거나 관련이 있을 것으로 기대되는 것이 아니라, 지나치게 홍보적인 성격을 가진 광고라고 생각합니다.”, :notify_moderators=>“게시물이 모더레이터의 주의 를 위해 플래그되었습니다: 커뮤니티는 이 게시물에 대해 스태프의 수동 개입이 필요하다고 생각합니다.”, :responder=>{:off_topic=>“게시물이 **오프톱(off-topic)**으로 플래그되었습니다: 커뮤니티는 현재 제목과 첫 게시물로 정의된 주제와 잘 맞지 않는다고 생각합니다.”, :inappropriate=>“게시물이 **부적절(inappropriate)**로 플래그되었습니다: 커뮤니티는 이 게시물이 offensive, 악의적, 증오 발언 또는 커뮤니티 가이드라인 위반이라고 생각합니다.”, :spam=>“게시물이 **스팸(spam)**으로 플래그되었습니다: 커뮤니티는 이 게시물이 주제에 유용하거나 관련이 있을 것으로 기대되는 것이 아니라, 지나치게 홍보적인 성격을 가진 광고라고 생각합니다.”, :notify_moderators=>“게시물이 모더레이터의 주의 를 위해 플래그되었습니다: 커뮤니티는 이 게시물에 대해 스태프의 수동 개입이 필요하다고 생각합니다.”}}
상세 내용은 커뮤니티 가이드라인 을 확인해 주세요.
사용자가 수신하는 이메일의 포맷을 보여주는 스크린샷입니다:
재현 단계:
Discourse에서 모든 사용자의 첫 게시물이 승인되도록 설정되어 있는지 확인합니다.
새 사용자를 생성합니다.
새 사용자로 새 게시물을 생성합니다.
관리자 계정을 사용하여 “Delete user” 옵션으로 게시물을 거부(reject)합니다.
새 사용자에게 위 내용과 함께 이메일이 전송됩니다.
2개의 좋아요
Richie
(Richie Rich)
9월 12, 2025, 7: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개의 좋아요
selase
(Selase Krakani)
이 글을 에 분리
11월 18, 2025, 11:45오전
3
selase
(Selase Krakani)
9월 12, 2025, 6: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개의 좋아요
Moin
9월 12, 2025, 6:43오후
6
I am sure it does. I mentioned that in May
3개의 좋아요
selase
(Selase Krakani)
11월 18, 2025, 11:51오전
7
OP에서 언급된 문제에 대한 수정 사항을 병합했습니다. 수정이 완료될 때까지 추적을 용이하게 하기 위해 스테이징된 사용자와 관련된 보고서를 별도의 토픽 으로 이동했습니다.
main ← fix/deleted-user-email
merged 03:22PM - 17 Nov 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개의 좋아요