mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 16:36:07 +08:00
FEATURE: Add 'New users only' option to user_updated trigger (#26648)
This commit adds a new option to the `user_updated` trigger of the automation plugin to only trigger an automation for new users that join after the automation is enabled. Internal topic: t/125829/9.
This commit is contained in:
@ -208,6 +208,9 @@ after_initialize do
|
||||
register_topic_custom_field_type(DiscourseAutomation::AUTO_RESPONDER_TRIGGERED_IDS, [:integer])
|
||||
|
||||
on(:user_updated) { |user| DiscourseAutomation::EventHandlers.handle_user_updated(user) }
|
||||
on(:user_created) do |user|
|
||||
DiscourseAutomation::EventHandlers.handle_user_updated(user, new_user: true)
|
||||
end
|
||||
|
||||
register_user_custom_field_type(DiscourseAutomation::CUSTOM_FIELD, [:integer])
|
||||
register_post_custom_field_type(DiscourseAutomation::CUSTOM_FIELD, [:integer])
|
||||
|
Reference in New Issue
Block a user