ishapi 0.1.8.261 → 0.1.8.262
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/ishapi/email_message_intake_job.rb +12 -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: 56ee75d806b0386f4ed6711f5dd5ad41ea5e019e390c8fefab935033c3610672
|
4
|
+
data.tar.gz: d88e1a906604273915df89242b51414647fad2212b7f517e7994f72c98d095b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbd12b11c6ea6e8aebf9ac0989b2b17e964e3dc8534f64e7490a5f985d3069c05b4851986a13036babdc6e883452c25e086f6a428cfcef28ed9814c166a223f1
|
7
|
+
data.tar.gz: 13593424d2ee64a60c26bbd225637bae0be4903cfb8249e567b0a2e5b8d1ca218e5abd4f91ce5f4457bfc796c68c55db0d3fe5a212f99ef38d5c78959b7a76dc
|
@@ -135,26 +135,30 @@ 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 ( @message.from.match( filter.from_regex ) ||
|
139
|
+
@message.part_html.match( filter.body_regex ) ||
|
140
|
+
@message.subject.match( filter.subject_regex )
|
141
|
+
)
|
140
142
|
# || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
|
143
|
+
|
141
144
|
@message.apply_filter( filter )
|
142
145
|
end
|
143
146
|
end
|
144
147
|
|
145
148
|
## Save to exit
|
146
149
|
flag = @message.save
|
147
|
-
if flag
|
148
|
-
|
149
|
-
else
|
150
|
-
|
151
|
-
end
|
150
|
+
# if flag
|
151
|
+
# puts! @message.message_id, 'Saved this message'
|
152
|
+
# else
|
153
|
+
# puts! @message.errors.full_messages.join(', '), 'Cannot save email_message'
|
154
|
+
# end
|
152
155
|
conv.save
|
153
156
|
stub.update_attributes({ state: ::Office::EmailMessageStub::STATE_PROCESSED })
|
154
157
|
|
155
158
|
## Notification
|
156
159
|
if conv.wp_term_ids.include?( email_inbox_tag_id )
|
157
|
-
::Ishapi::ApplicationMailer.forwarder_notify( @message.id.to_s )
|
160
|
+
out = ::Ishapi::ApplicationMailer.forwarder_notify( @message.id.to_s )
|
161
|
+
Rails.env.production? ? out.deliver_later : out.deliver_now
|
158
162
|
end
|
159
163
|
|
160
164
|
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.262
|
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
|