iachat/enterprise/app/services/captain/lifecycle/guards/opt_out_label.rb
2026-04-15 01:42:10 -03:00

17 lines
419 B
Ruby

# frozen_string_literal: true
class Captain::Lifecycle::Guards::OptOutLabel < Captain::Lifecycle::Guards::Base
def check
config = Captain::Lifecycle::Config.for_account(@account)
label = config.opt_out_label
return pass if label.blank?
contact = @reservation.contact
return pass if contact.blank?
return skip('opt_out_label') if contact.label_list.include?(label.title)
pass
end
end