0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 16:57:36 +08:00
discourse/plugins/automation/lib/discourse_automation/triggers.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

25 lines
834 B
Ruby
Vendored

# frozen_string_literal: true
module DiscourseAutomation
module Triggers
AFTER_POST_COOK = "after_post_cook"
API_CALL = "api_call"
CATEGORY_CREATED_EDITED = "category_created_edited"
POST_FLAG_CREATED = "post_flag_created"
PM_CREATED = "pm_created"
TOPIC_TAGS_CHANGED = "topic_tags_changed"
POINT_IN_TIME = "point_in_time"
POST_CREATED_EDITED = "post_created_edited"
RECURRING = "recurring"
STALLED_TOPIC = "stalled_topic"
STALLED_WIKI = "stalled_wiki"
TOPIC = "topic"
TOPIC_CLOSED = "topic_closed"
USER_ADDED_TO_GROUP = "user_added_to_group"
USER_BADGE_GRANTED = "user_badge_granted"
USER_FIRST_LOGGED_IN = "user_first_logged_in"
USER_PROMOTED = "user_promoted"
USER_REMOVED_FROM_GROUP = "user_removed_from_group"
USER_UPDATED = "user_updated"
end
end