wco_models 3.1.0.72 → 3.1.0.74
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '001333244903db535c3a5a5dcdcb6ed004dade16013fbf4076fe0bf2a2906ac5'
|
4
|
+
data.tar.gz: b32bd3b75f89fac0022b3ac29ffc2ae808840d95c334de2457b44356764d2c7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83f6a385a033a7a49e5bc45fd9f3fb5f8e9cbf3bf43167bd43e0444dc0829a656aa229d14bc0b7ac4ff6d67d9ac0f392cdf7d622b281237480786440fb428fce
|
7
|
+
data.tar.gz: e723c180e2445f15ce7e2dc963f01afa0d1033e7521c49d3c2e0f85c14e52ce38474c3fc76b5076c88823d9bdfb75fb1dcf79637fb03b59538c8fbcc0c57f8c7
|
@@ -73,9 +73,8 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
|
|
73
73
|
renderer.instance_variable_set( :@tmpl_config, @tmpl_config )
|
74
74
|
|
75
75
|
rendered_str = renderer.render_to_string("/wco_email/email_templates/_#{@ctx.tmpl.layout}")
|
76
|
-
@ctx.update
|
76
|
+
@ctx.update({
|
77
77
|
rendered_str: rendered_str,
|
78
|
-
sent_at: Time.now.to_s,
|
79
78
|
})
|
80
79
|
|
81
80
|
mail( from: @ctx.from_email,
|
@@ -35,7 +35,7 @@ class WcoEmail::EmailFilter
|
|
35
35
|
|
36
36
|
STATUS_ACTIVE = 'active'
|
37
37
|
STATUS_INACTIVE = 'inactive'
|
38
|
-
|
38
|
+
STATUSES = [ STATUS_ACTIVE, STATUS_INACTIVE ]
|
39
39
|
field :status, type: :string, default: STATUS_ACTIVE
|
40
40
|
scope :active, ->{ where( status: STATUS_ACTIVE ) }
|
41
41
|
|
@@ -180,19 +180,19 @@ class WcoEmail::MessageStub
|
|
180
180
|
email_filters = WcoEmail::EmailFilter.active
|
181
181
|
email_filters.each do |filter|
|
182
182
|
reson = nil
|
183
|
-
if filter.from_regex && @message.from.downcase.match( filter.from_regex )
|
183
|
+
if filter.from_regex.present? && @message.from.downcase.match( filter.from_regex )
|
184
184
|
reason = 'from_regex'
|
185
185
|
end
|
186
|
-
if filter.from_exact && @message.from.downcase.include?( filter.from_exact.downcase )
|
186
|
+
if filter.from_exact.present? && @message.from.downcase.include?( filter.from_exact.downcase )
|
187
187
|
reason = 'from_exact'
|
188
188
|
end
|
189
|
-
if filter.body_exact && @message.part_html&.include?( filter.body_exact )
|
189
|
+
if filter.body_exact.present? && @message.part_html&.include?( filter.body_exact )
|
190
190
|
reason = 'body_exact'
|
191
191
|
end
|
192
|
-
if filter.subject_regex && @message.subject.match( filter.subject_regex )
|
192
|
+
if filter.subject_regex.present? && @message.subject.match( filter.subject_regex )
|
193
193
|
reason = 'subject_regex'
|
194
194
|
end
|
195
|
-
if filter.subject_exact && @message.subject.downcase.include?( filter.subject_exact.downcase )
|
195
|
+
if filter.subject_exact.present? && @message.subject.downcase.include?( filter.subject_exact.downcase )
|
196
196
|
reason = 'subject_exact'
|
197
197
|
end
|
198
198
|
|