mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +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:
parent
1a223b9d10
commit
6fabb341f1
3 changed files with 41 additions and 7 deletions
|
@ -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 = {})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue