0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/plugins/automation/lib/discourse_automation/triggers/post_flag_created.rb
Sam e67d9b5f66
FEATURE: New automation for emailing specific users when a post is flagged (#36580)
This commit adds a new "Email on flagged post" automation which can be configured to send emails to users when a post is flagged. The automation can be configured to trigger only when posts are flagged in certain categories or only when certain tags are present on the post's topic.

The body of the email sent can also be configured with the following placeholders available: 

* topic_url
* topic_title
* post_url
* post_number
* flagger_username
* flagged_username
* flag_type
* category
* tags
* post_excerpt
2025-12-11 10:31:13 +08:00

17 lines
466 B
Ruby
Vendored

# frozen_string_literal: true
DiscourseAutomation::Triggerable.add(DiscourseAutomation::Triggers::POST_FLAG_CREATED) do
field :categories, component: :categories
field :tags, component: :tags
placeholder :topic_url
placeholder :topic_title
placeholder :post_url
placeholder :post_number
placeholder :flagger_username
placeholder :flagged_username
placeholder :flag_type
placeholder :category
placeholder :tags
placeholder :post_excerpt
end