Sha256: 7ce1f60b59ca2d68cb1e40d75f460ff3eca06fe4fe06c3e1f8db0ba4b78d4c43

Contents?: true

Size: 1.29 KB

Versions: 21

Compression:

Stored size: 1.29 KB

Contents

##
## 2023-03-04 _vp_ When I receive one.
##
class WcoEmail::EmailFilter
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Paranoia
  store_in collection: 'office_email_filters' # 'wco_email_email_filters'

  field :from_regex
  field :from_exact
  field :subject_regex
  field :subject_exact
  field :body_regex
  field :body_exact


  KIND_AUTORESPOND_TMPL = 'autorespond-template'
  KIND_AUTORESPOND_EACT = 'autorespond-email-action'
  KIND_REMOVE_TAG       = 'remove-tag'
  KIND_ADD_TAG          = 'add-tag'
  KIND_DESTROY_SCHS     = 'destroy-schs'

  KIND_AUTORESPOND = 'autorespond' # @deprecated, DO NOT USE!
  KIND_DELETE      = 'delete'      # @deprecated, use add-tag
  KIND_SKIP_INBOX  = 'skip-inbox'  # @deprecated, use remove-tag

  KINDS = [ nil, KIND_AUTORESPOND_TMPL, KIND_AUTORESPOND_EACT, KIND_ADD_TAG, KIND_REMOVE_TAG, KIND_DESTROY_SCHS]
  field :kind

  STATUS_ACTIVE   = 'active'
  STATUS_INACTIVE = 'inactive'
  STATUSS = [ STATUS_ACTIVE, STATUS_INACTIVE ]
  field :status, type: :string, default: STATUS_ACTIVE
  scope :active, ->{ where( status: STATUS_ACTIVE ) }

  belongs_to :email_template,        class_name: 'WcoEmail::EmailTemplate',         optional: true
  belongs_to :email_action_template, class_name: 'WcoEmail::EmailActionTemplate',   optional: true

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
wco_models-3.1.0.58 app/models/wco_email/email_filter.rb
wco_models-3.1.0.57 app/models/wco_email/email_filter.rb
wco_models-3.1.0.56 app/models/wco_email/email_filter.rb
wco_models-3.1.0.55 app/models/wco_email/email_filter.rb
wco_models-3.1.0.54 app/models/wco_email/email_filter.rb
wco_models-3.1.0.53 app/models/wco_email/email_filter.rb
wco_models-3.1.0.52 app/models/wco_email/email_filter.rb
wco_models-3.1.0.51 app/models/wco_email/email_filter.rb
wco_models-3.1.0.50 app/models/wco_email/email_filter.rb
wco_models-3.1.0.49 app/models/wco_email/email_filter.rb
wco_models-3.1.0.48 app/models/wco_email/email_filter.rb
wco_models-3.1.0.47 app/models/wco_email/email_filter.rb
wco_models-3.1.0.46 app/models/wco_email/email_filter.rb
wco_models-3.1.0.45 app/models/wco_email/email_filter.rb
wco_models-3.1.0.44 app/models/wco_email/email_filter.rb
wco_models-3.1.0.43 app/models/wco_email/email_filter.rb
wco_models-3.1.0.42 app/models/wco_email/email_filter.rb
wco_models-3.1.0.41 app/models/wco_email/email_filter.rb
wco_models-3.1.0.40 app/models/wco_email/email_filter.rb
wco_models-3.1.0.39 app/models/wco_email/email_filter.rb