ishapi 0.1.8.289 → 0.1.8.290
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 +8 -8
- 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: afc65013f9b8c9420320ffaddd059a328430126c3b0be0326041449e0d330b96
|
4
|
+
data.tar.gz: 0b2a0202de0251bfa4ad4c7ae80b84f9062688f9a685f48c8577c209637fdb5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d8137e429313ddd6104bb6bd686a479079d18269b579c179a3f5d240877650c2c5451d5beb71c117b90eaeab865856bfd5db776f767868324ad580a614263ed
|
7
|
+
data.tar.gz: ad65080c8891232fd4000830dd4f66585c260e52db59103f4c7a07c63bb29045f8f38a403702720cbaa67ed86ee4a078612b0ada309805d545e2deabae310e77
|
@@ -80,16 +80,16 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
80
80
|
object_key: stub.object_key,
|
81
81
|
# object_path: stub.object_path,
|
82
82
|
|
83
|
-
subject: the_mail.subject,
|
83
|
+
subject: the_mail.subject || 'NO SUBJECT HEREZZ',
|
84
84
|
date: the_mail.date,
|
85
85
|
|
86
|
-
from: the_mail.from[0],
|
86
|
+
from: the_mail.from ? the_mail.from[0] : "NOBODY@UNKNOWN.DOMAIN",
|
87
87
|
froms: the_mail.from,
|
88
88
|
|
89
|
-
to: the_mail.to[0],
|
89
|
+
to: the_mail.to ? the_mail.to[0] : nil,
|
90
90
|
tos: the_mail.to,
|
91
91
|
|
92
|
-
cc: the_mail.cc[0],
|
92
|
+
cc: the_mail.cc ? the_mail.cc[0] : nil,
|
93
93
|
ccs: the_mail.cc,
|
94
94
|
|
95
95
|
# bccs: the_mail.bcc,
|
@@ -130,7 +130,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
130
130
|
end
|
131
131
|
|
132
132
|
## Leadset, Lead
|
133
|
-
domain = @message.from.split('@')[1]
|
133
|
+
domain = @message.from.split('@')[1] rescue 'UNKNOWN.DOMAIN'
|
134
134
|
leadset = Leadset.find_or_create_by( company_url: domain )
|
135
135
|
lead = Lead.find_or_create_by( email: @message.from, m3_leadset_id: leadset.id )
|
136
136
|
|
@@ -156,7 +156,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
156
156
|
conv.update_attributes({
|
157
157
|
state: Conv::STATE_UNREAD,
|
158
158
|
latest_at: the_mail.date || Time.now.to_datetime,
|
159
|
-
from_emails: conv.from_emails
|
159
|
+
from_emails: conv.from_emails + the_mail.from,
|
160
160
|
})
|
161
161
|
conv.add_tag( ::WpTag::INBOX )
|
162
162
|
conv_lead_tie = Office::EmailConversationLead.find_or_create_by({
|
@@ -169,10 +169,10 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
169
169
|
email_filters = Office::EmailFilter.active
|
170
170
|
email_filters.each do |filter|
|
171
171
|
if ( filter.from_regex.blank? || @message.from.match( filter.from_regex ) ) &&
|
172
|
-
( filter.from_exact.blank? || @message.from
|
172
|
+
( filter.from_exact.blank? || @message.from.downcase.include?( filter.from_exact&.downcase ) ) &&
|
173
173
|
( filter.body_exact.blank? || @message.part_html.include?( filter.body_exact ) ) &&
|
174
174
|
( filter.subject_regex.blank? || @message.subject.match( filter.subject_regex ) ) &&
|
175
|
-
( filter.subject_exact.blank? || @message.subject
|
175
|
+
( filter.subject_exact.blank? || @message.subject.downcase.include?( filter.subject_exact&.downcase ) )
|
176
176
|
|
177
177
|
# || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
|
178
178
|
|