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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c5121e3c2c5a183492a8669867a7de2045d2f7da5b2e1d411cbc4f3a75dff9d
4
- data.tar.gz: 1a8405721d7b70ac2032d92fee8ca1b9041535b77ee239764e23f50a45512369
3
+ metadata.gz: afc65013f9b8c9420320ffaddd059a328430126c3b0be0326041449e0d330b96
4
+ data.tar.gz: 0b2a0202de0251bfa4ad4c7ae80b84f9062688f9a685f48c8577c209637fdb5c
5
5
  SHA512:
6
- metadata.gz: 243803b2209833ae066372680e06e2aaff06a7f67f98059cd4f11c291bf03836dbcd3150b0081a45b3942afae4fdd1b3ba91d3ffc1a75405d5990063dcba8174
7
- data.tar.gz: bada09756fd108e9f1d567eb5b5254f2f966bbbb829588cb56836c51cd79758547f40f5f19ea8da8d4dab1897279ad524c91d6a280919c65641f952a2362620b
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.push( the_mail.from[0] ).uniq,
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&.downcase.include?( filter.from_exact&.downcase ) ) &&
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&.downcase.include?( filter.subject_exact&.downcase ) )
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.289
4
+ version: 0.1.8.290
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox