ishapi 0.1.8.307 → 0.1.8.308
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 +7 -10
- 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: d2c02f71e6adddb15a1722d560e9a8b9f56a5a10daa82471cb60bc9b9399000f
|
4
|
+
data.tar.gz: a3d36b4b360ddf7285ce4950e9d5adb9a784beff39117c4b37a23914234d490c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24949079b8dae5559f5046e42e693610ae5943f9a81fd4e461ee7fa1310998dff2120d60ceaf26b64356bd2d46a98168c0dc9c03e1958f1d4355f9d5a0fd5898
|
7
|
+
data.tar.gz: fc860e2a11a220c176cd5c67f0d0ce7766f6198dbac1fd50be0cdb4b7fdec44c315587f134e355273413b507c723e70515520772db9101be01233461bfba15bb
|
@@ -41,14 +41,10 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
41
41
|
message_id = the_mail.header['message-id'].decoded
|
42
42
|
in_reply_to_id = the_mail.header['in-reply-to']&.to_s
|
43
43
|
email_inbox_tag_id = WpTag.emailtag(WpTag::INBOX).id
|
44
|
-
|
45
|
-
if !the_mail.to
|
46
|
-
the_mail.to = [ 'NO-RECIPIENT' ]
|
47
|
-
end
|
48
|
-
|
44
|
+
the_mail.to = [ 'NO-RECIPIENT' ] if !the_mail.to
|
49
45
|
|
50
46
|
subject = ::Msg.strip_emoji the_mail.subject
|
51
|
-
subject ||= '(wco
|
47
|
+
subject ||= '(wco-no-subject)'
|
52
48
|
|
53
49
|
|
54
50
|
## Conversation
|
@@ -79,7 +75,6 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
79
75
|
in_reply_to_id: in_reply_to_id,
|
80
76
|
|
81
77
|
object_key: stub.object_key,
|
82
|
-
# object_path: stub.object_path,
|
83
78
|
|
84
79
|
subject: subject,
|
85
80
|
date: the_mail.date,
|
@@ -92,8 +87,6 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
92
87
|
|
93
88
|
cc: the_mail.cc ? the_mail.cc[0] : nil,
|
94
89
|
ccs: the_mail.cc,
|
95
|
-
|
96
|
-
# bccs: the_mail.bcc,
|
97
90
|
})
|
98
91
|
if !@message.persisted?
|
99
92
|
throw "Could not create email_message: #{@message.errors.full_messages.join(', ')} ."
|
@@ -159,6 +152,10 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
159
152
|
end
|
160
153
|
end
|
161
154
|
|
155
|
+
if !@message.save
|
156
|
+
puts! @message.errors.full_messages.join(", "), "Could not save @message"
|
157
|
+
end
|
158
|
+
|
162
159
|
## Leadset, Lead
|
163
160
|
domain = @message.from.split('@')[1] rescue 'unknown.domain'
|
164
161
|
leadset = Leadset.find_or_create_by( company_url: domain )
|
@@ -194,7 +191,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
194
191
|
|
195
192
|
# || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
|
196
193
|
|
197
|
-
puts! "applying filter #{filter} to conv #{conv}" if DEBUG
|
194
|
+
# puts! "applying filter #{filter} to conv #{conv}" if DEBUG
|
198
195
|
|
199
196
|
@message.apply_filter( filter )
|
200
197
|
end
|