ishapi 0.1.8.261 → 0.1.8.263
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 +4 -4
- data/app/jobs/ishapi/email_message_intake_job.rb +11 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ab645179f5378ac422a64f86bf835cfd005a3d1e1e68400d0981fea74c77d6a
|
4
|
+
data.tar.gz: 0735c8adcc43ab9cad6ec1ec1b0c9844b3a2d85cec5b53167a2105db69638fa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 683aa847832ad85b51d707e95bbdf7b11bd7dcfaa5357838bf29e604da00362afed580ebdeca4169d05a0f9071c407e5e6fb04d7632793cd739ea61241482240
|
7
|
+
data.tar.gz: 8646b7b57233b084c914ea8e48bddc627d16176b15d23932920820e6f702c2b9e356b994a426ae456869ce6004e95c2fbeaf3421536b68368567ddf7db181eeb
|
@@ -135,26 +135,29 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
135
135
|
## Actions & Filters
|
136
136
|
email_filters = Office::EmailFilter.active
|
137
137
|
email_filters.each do |filter|
|
138
|
-
if @message.from.match(
|
139
|
-
|
138
|
+
if ( filter.from_regex.blank? || @message.from.match( filter.from_regex ) ) &&
|
139
|
+
( filter.body_regex.blank? || @message.part_html.match( filter.body_regex ) ) &&
|
140
|
+
( filter.subject_regex.blank? || @message.subject.match( filter.subject_regex ) )
|
140
141
|
# || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
|
142
|
+
|
141
143
|
@message.apply_filter( filter )
|
142
144
|
end
|
143
145
|
end
|
144
146
|
|
145
147
|
## Save to exit
|
146
148
|
flag = @message.save
|
147
|
-
if flag
|
148
|
-
|
149
|
-
else
|
150
|
-
|
151
|
-
end
|
149
|
+
# if flag
|
150
|
+
# puts! @message.message_id, 'Saved this message'
|
151
|
+
# else
|
152
|
+
# puts! @message.errors.full_messages.join(', '), 'Cannot save email_message'
|
153
|
+
# end
|
152
154
|
conv.save
|
153
155
|
stub.update_attributes({ state: ::Office::EmailMessageStub::STATE_PROCESSED })
|
154
156
|
|
155
157
|
## Notification
|
156
158
|
if conv.wp_term_ids.include?( email_inbox_tag_id )
|
157
|
-
::Ishapi::ApplicationMailer.forwarder_notify( @message.id.to_s )
|
159
|
+
out = ::Ishapi::ApplicationMailer.forwarder_notify( @message.id.to_s )
|
160
|
+
Rails.env.production? ? out.deliver_later : out.deliver_now
|
158
161
|
end
|
159
162
|
|
160
163
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ishapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.263
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|