Sha256: fe4edce2df15c336c2a4dc73bea0416e5cd2bc59029d4460ec30546b7e68cbb3

Contents?: true

Size: 1.3 KB

Versions: 71

Compression:

Stored size: 1.3 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'

  PAGE_PARAM_NAME = :filters_page

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

  belongs_to :tag, class_name: 'Wco::Tag', inverse_of: :email_filters, optional: true

  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'

  ## @deprecated
  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

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

  has_many :conversations, class_name: 'WcoEmail::Conversation', inverse_of: :filter

end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
wco_models-3.1.0.149 app/models/wco_email/email_filter.rb
wco_models-3.1.0.148 app/models/wco_email/email_filter.rb
wco_models-3.1.0.147 app/models/wco_email/email_filter.rb
wco_models-3.1.0.146 app/models/wco_email/email_filter.rb
wco_models-3.1.0.145 app/models/wco_email/email_filter.rb
wco_models-3.1.0.144 app/models/wco_email/email_filter.rb
wco_models-3.1.0.143 app/models/wco_email/email_filter.rb
wco_models-3.1.0.142 app/models/wco_email/email_filter.rb
wco_models-3.1.0.141 app/models/wco_email/email_filter.rb
wco_models-3.1.0.140 app/models/wco_email/email_filter.rb
wco_models-3.1.0.139 app/models/wco_email/email_filter.rb
wco_models-3.1.0.138 app/models/wco_email/email_filter.rb
wco_models-3.1.0.137 app/models/wco_email/email_filter.rb
wco_models-3.1.0.136 app/models/wco_email/email_filter.rb
wco_models-3.1.0.135 app/models/wco_email/email_filter.rb
wco_models-3.1.0.134 app/models/wco_email/email_filter.rb
wco_models-3.1.0.133 app/models/wco_email/email_filter.rb
wco_models-3.1.0.132 app/models/wco_email/email_filter.rb
wco_models-3.1.0.131 app/models/wco_email/email_filter.rb
wco_models-3.1.0.130 app/models/wco_email/email_filter.rb