mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: automatically archive welcome messages for site_contact_user
This de-clutters the sent messages box for site_contact_user, making it again usable
This commit is contained in:
@ -23,12 +23,17 @@ class SystemMessage
|
||||
title = I18n.t("system_messages.#{type}.subject_template", params)
|
||||
raw = I18n.t("system_messages.#{type}.text_body_template", params)
|
||||
|
||||
PostCreator.create(Discourse.site_contact_user,
|
||||
post = PostCreator.create(Discourse.site_contact_user,
|
||||
title: title,
|
||||
raw: raw,
|
||||
archetype: Archetype.private_message,
|
||||
target_usernames: @recipient.username,
|
||||
subtype: TopicSubtype.system_message)
|
||||
|
||||
|
||||
UserArchivedMessage.create!(user: Discourse.site_contact_user, topic: post.topic)
|
||||
|
||||
post
|
||||
end
|
||||
|
||||
def create_from_system_user(type, params = {})
|
||||
|
Reference in New Issue
Block a user