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:
Osama Sayegh
2024-04-16 21:13:11 +03:00
committed by GitHub
parent 57d29b6f3b
commit 4733369f71
7 changed files with 190 additions and 2 deletions

View File

@ -8,6 +8,7 @@ DiscourseAutomation::Triggerable.add(DiscourseAutomation::Triggers::USER_UPDATED
field :custom_fields, component: :custom_fields
field :user_profile, component: :user_profile
field :once_per_user, component: :boolean
field :new_users_only, component: :boolean
validate do
has_triggers = has_trigger_field?(:custom_fields) && has_trigger_field?(:user_profile)