ishapi 0.1.8.304 → 0.1.8.305
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 +5 -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: fc372746027421f9ac7c60e85da6d38c0032e9a8070a8ae3d43e360406896fba
|
|
4
|
+
data.tar.gz: c55c1545c1f1dd9fb02933362c60129c3856831250e8855042edb3a1eb9260b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd966429e4ddadd59d1464c3fb93161d5f232db3045a3af8b474bf8d56275f689745c509360b6ab42e5a11ac50d693c73ea4c99b21b0acd07b8723b05b4d2bdb
|
|
7
|
+
data.tar.gz: 108f40bb94ade6afededba38d9c0e9edef891b2e746bb16108a8719669d056e1b6b40d5bb3a21289ed8dac022c73c3015a7bc796596678b8c1db105e4948750b
|
|
@@ -36,8 +36,8 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
|
36
36
|
secret_access_key: ::S3_CREDENTIALS[:secret_access_key_ses],
|
|
37
37
|
})
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
the_mail = Mail.new(
|
|
39
|
+
raw = client.get_object( bucket: ::S3_CREDENTIALS[:bucket_ses], key: stub.object_key ).body.read
|
|
40
|
+
the_mail = Mail.new( raw )
|
|
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
|
|
@@ -52,7 +52,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
|
52
52
|
|
|
53
53
|
@message = ::Office::EmailMessage.where( message_id: message_id ).first
|
|
54
54
|
@message ||= ::Office::EmailMessage.create({
|
|
55
|
-
raw:
|
|
55
|
+
raw: raw,
|
|
56
56
|
|
|
57
57
|
message_id: message_id,
|
|
58
58
|
in_reply_to_id: in_reply_to_id,
|
|
@@ -75,13 +75,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
|
75
75
|
# bccs: the_mail.bcc,
|
|
76
76
|
})
|
|
77
77
|
if !@message.persisted?
|
|
78
|
-
|
|
79
|
-
end
|
|
80
|
-
if the_mail.body.preamble.present?
|
|
81
|
-
@message.preamble = the_mail.body.preamble
|
|
82
|
-
end
|
|
83
|
-
if the_mail.body.epilogue.present?
|
|
84
|
-
@message.epilogue = the_mail.body.epilogue
|
|
78
|
+
throw "Could not create email_message: #{@message.errors.full_messages.join(', ')} ."
|
|
85
79
|
end
|
|
86
80
|
|
|
87
81
|
## Parts
|
|
@@ -160,6 +154,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
|
|
|
160
154
|
state: Conv::STATE_UNREAD,
|
|
161
155
|
latest_at: the_mail.date || Time.now.to_datetime,
|
|
162
156
|
from_emails: ( conv.from_emails + the_mail.from ).uniq,
|
|
157
|
+
preview: @message.body_sanitized[0...200],
|
|
163
158
|
})
|
|
164
159
|
conv.add_tag( ::WpTag::INBOX )
|
|
165
160
|
conv_lead_tie = Office::EmailConversationLead.find_or_create_by({
|