mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FIX: TL2 promotion message and advance training (#10679)
This is a little bit of refactoring. Core Discourse should have default promotion message for TL2. In addition, when the Discobot plugin is enabled, the user is invited to advanced training
This commit is contained in:

committed by
GitHub

parent
8867bd4abe
commit
0bb51dcbfa
@ -1,23 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Jobs
|
||||
class SendAdvancedTutorialMessage < ::Jobs::Base
|
||||
def execute(args)
|
||||
user = User.find_by(id: args[:user_id])
|
||||
return if user.nil?
|
||||
|
||||
raw = I18n.t("discourse_narrative_bot.tl2_promotion_message.text_body_template",
|
||||
discobot_username: ::DiscourseNarrativeBot::Base.new.discobot_username,
|
||||
reset_trigger: "#{::DiscourseNarrativeBot::TrackSelector.reset_trigger} #{::DiscourseNarrativeBot::AdvancedUserNarrative.reset_trigger}")
|
||||
|
||||
PostCreator.create!(
|
||||
Discourse.system_user,
|
||||
title: I18n.t("discourse_narrative_bot.tl2_promotion_message.subject_template"),
|
||||
raw: raw,
|
||||
archetype: Archetype.private_message,
|
||||
target_usernames: user.username,
|
||||
skip_validations: true
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user