FEATURE: Post created/edited trigger can skip posts created via email (#28615)

This commit is contained in:
Roman Rizzi
2024-08-28 17:34:35 -03:00
committed by GitHub
parent 6f91014d64
commit 715f49c3fe
4 changed files with 44 additions and 0 deletions

View File

@ -23,6 +23,11 @@ module DiscourseAutomation
next if post.user.user_stat.topic_count != 1
end
skip_via_email = automation.trigger_field("skip_via_email")
if skip_via_email["value"]
next if post.via_email?
end
valid_trust_levels = automation.trigger_field("valid_trust_levels")
if valid_trust_levels["value"]
next if valid_trust_levels["value"].exclude?(post.user.trust_level)