wco_models 3.1.0.77 → 3.1.0.78
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/wco_email/email_filter.rb +0 -6
- data/app/models/wco_email/message_stub.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0f8f4f03a6fe53303a403050d9ca34e5b81caefda6dbeef36ea5b994643ebe9
|
4
|
+
data.tar.gz: b8b19c8349d9783a54ee8da11db8a414506164216a4e87f9b6cd3f4768eb8f9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98de670421120a2e745a6af46cecd4238a9528bc0c001a12135469c54e3de70e69222910f8a63a5de3c051953f272685786f5953dd87cb1d03ca490dcb0581fb
|
7
|
+
data.tar.gz: f775ed1e9c82d7464d837c6325fb1b2308436352743bff39617165ebeea1617424929ef69366249fc83376c0eee287aec69b9268e1ba78c2fe649c14a08a6d6e
|
@@ -33,12 +33,6 @@ class WcoEmail::EmailFilter
|
|
33
33
|
KINDS = [ nil, KIND_AUTORESPOND_TMPL, KIND_AUTORESPOND_EACT, KIND_ADD_TAG, KIND_REMOVE_TAG, KIND_DESTROY_SCHS]
|
34
34
|
field :kind
|
35
35
|
|
36
|
-
STATUS_ACTIVE = 'active'
|
37
|
-
STATUS_INACTIVE = 'inactive'
|
38
|
-
STATUSES = [ STATUS_ACTIVE, STATUS_INACTIVE ]
|
39
|
-
field :status, type: :string, default: STATUS_ACTIVE
|
40
|
-
scope :active, ->{ where( status: STATUS_ACTIVE ) }
|
41
|
-
|
42
36
|
belongs_to :email_template, class_name: 'WcoEmail::EmailTemplate', optional: true
|
43
37
|
belongs_to :email_action_template, class_name: 'WcoEmail::EmailActionTemplate', optional: true
|
44
38
|
|
@@ -178,9 +178,9 @@ class WcoEmail::MessageStub
|
|
178
178
|
|
179
179
|
|
180
180
|
## Actions & Filters
|
181
|
-
email_filters = WcoEmail::EmailFilter.
|
181
|
+
email_filters = WcoEmail::EmailFilter.all
|
182
182
|
email_filters.each do |filter|
|
183
|
-
|
183
|
+
reason = nil
|
184
184
|
if filter.from_regex.present? && @message.from.downcase.match( filter.from_regex )
|
185
185
|
reason = 'from_regex'
|
186
186
|
end
|
@@ -198,7 +198,7 @@ class WcoEmail::MessageStub
|
|
198
198
|
end
|
199
199
|
|
200
200
|
if reason
|
201
|
-
puts! "Applying filter #{filter} to conv #{
|
201
|
+
puts! "Applying filter #{filter} to conv #{@message.conversation} for matching #{reason}" if DEBUG
|
202
202
|
@message.apply_filter( filter )
|
203
203
|
end
|
204
204
|
end
|