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
도움이 된다면, 거부된 게시글의 관리자 화면 스크린샷 두 장을 첨부합니다:
사용자를 삭제하기 전:
거부 및 삭제 후:
1개의 좋아요
selase
(Selase Krakani)
이 글을 에 분리
11월 18, 2025, 11:45오전
3
selase
(Selase Krakani)
9월 12, 2025, 6:24오후
4
여기서 flag_reason가 생성되는 방식에 버그가 있는 것 같습니다:
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에는 :needs_approval 플래그(설명된 플로우에서 생성됨)가 포함되어 있지 않습니다. 이로 인해 번역 키가 접미사 없이 flag_reasons.로 해석되어, 단일 항목 대신 YAML 섹션 전체가 반환됩니다. 이것이 플래그 이유 자리에 Ruby 해시가 표시되는 이유입니다.
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."
관련하여, 커스텀 플래그의 번역도 누락될 가능성이 높으므로 이 문제가 커스텀 플래그에도 영향을 미칠 것으로 보입니다.
7개의 좋아요
Moin
9월 12, 2025, 6:43오후
6
그렇다고 확신합니다. 지난 5월에 그걸 언급했었는데요.
Moin:
Moin:
참고:
이전에 언급했듯이 , flag reasons는 커스텀 플래그와 함께 작동하지 않습니다.
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개의 좋아요