wco_models 3.1.0.77 → 3.1.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47c1bfd514e6256509d803414d83c9788a784d763ef4f2d0498f2838b593c097
|
4
|
+
data.tar.gz: 525c22eab612f690439d427d0f714f937b6f77853ecad2fd6006b8f3fd4787e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4d06549e214c3e666b692fb01abeff916827efa2bc77e38468e624eec463b24a67290d8327c6b7667220a44c6c4c0595ede9d7abcf78f5b845fcc3b08b84d17
|
7
|
+
data.tar.gz: b7cdd068d8a5f9607fee162d093ae0e8671e34ee94641daab7274ed23f3dbcbe849852e9664b9668e729c545b46624e32ca19c7571b38fb2d8bf6f2971a60cc8
|
@@ -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
|
|
@@ -98,18 +98,19 @@ class WcoEmail::Message
|
|
98
98
|
conv.tags -= [ filter.tag ]
|
99
99
|
|
100
100
|
when WcoEmail::EmailFilter::KIND_AUTORESPOND_TMPL
|
101
|
-
WcoEmail::Context.create({
|
101
|
+
WcoEmail::Context.create!({
|
102
102
|
email_template: filter.email_template,
|
103
103
|
lead_id: lead.id,
|
104
104
|
send_at: Time.now,
|
105
105
|
})
|
106
106
|
|
107
107
|
when WcoEmail::EmailFilter::KIND_AUTORESPOND_EACT
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
108
|
+
# byebug
|
109
|
+
out = Sch.create!({
|
110
|
+
email_action_template: filter.email_action_template,
|
111
|
+
status: Sch::STATUS_ACTIVE,
|
112
|
+
lead_id: lead.id,
|
113
|
+
perform_at: Time.now,
|
113
114
|
})
|
114
115
|
|
115
116
|
else
|
@@ -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
|