mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:01:14 +08:00
FEATURE: add trigger_with_pms
option to topic tags changed
automation trigger (#29122)
This commit is contained in:
@ -224,6 +224,10 @@ module DiscourseAutomation
|
||||
DiscourseAutomation::Automation
|
||||
.where(trigger: name, enabled: true)
|
||||
.find_each do |automation|
|
||||
if topic.private_message?
|
||||
next if !automation.trigger_field("trigger_with_pms")["value"]
|
||||
end
|
||||
|
||||
watching_categories = automation.trigger_field("watching_categories")
|
||||
if watching_categories["value"]
|
||||
next if !watching_categories["value"].include?(topic.category_id)
|
||||
|
@ -3,6 +3,7 @@
|
||||
DiscourseAutomation::Triggerable.add(DiscourseAutomation::Triggers::TOPIC_TAGS_CHANGED) do
|
||||
field :watching_categories, component: :categories
|
||||
field :watching_tags, component: :tags
|
||||
field :trigger_with_pms, component: :boolean
|
||||
|
||||
placeholder :topic_url
|
||||
placeholder :topic_title
|
||||
|
Reference in New Issue
Block a user