ishapi 0.1.8.222 → 0.1.8.224

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79a045487ac24d706f7d8f02f10a548153673b0b0b13bb151fb284a3ccb3837e
4
- data.tar.gz: '08a915a9769757ec0519b5171ac2bbb17d9cc431af3dbea113b9558e1a090403'
3
+ metadata.gz: 1057e3a8d47ccb9a4c515bfe4b6db8f1b8a9c98bd15f389bd3a05f6f6c35f5ca
4
+ data.tar.gz: '019414d090c7b26c4226612ef4dace0ca8782a2dec00bb2f473d0559bb12c14c'
5
5
  SHA512:
6
- metadata.gz: 74c144dc50c96c1e6e684e064f1ff1696aba730573eccc9dc4673ab7fe35f3469cc995fdf0d2bcfee4e60b1f0c50aa81fadecac44ae53c354aeb888b69811110
7
- data.tar.gz: 5338869bbdd4d2762a050b60eccd91b8feaaed1613a9569ba0afb9e62b3419012d2a54f5400ee4dc1400976bbb20dd5fc7f14f738b1de498a056e734d7567b50
6
+ metadata.gz: 5f739ac7ffa01d05f5912408ae86cd907e7b93ec5cb8aa73e0a8022b0b1ab744b2a1b431b1aaae8c65beb779293c1a4f1954cb9188e5b7572d59a6aecc371933
7
+ data.tar.gz: e79cbab0ff9170b2b4e73bf016c472ad6fc5d7acdbba545b04a98f4ee9b117cb7982ef00ac9bfeb1f1959087b140125862ce938730278574869d63254c047087
@@ -9,19 +9,6 @@ Ishapi::EmailMessageIntakeJob.perform_now( stub.id.to_s )
9
9
 
10
10
  =end
11
11
 
12
- ## align companies do leads' domains
13
- =begin
14
- outs = Lead.all.map do |lead|
15
- domain = lead.email.split('@')[1]
16
- if lead.company.company_url == domain
17
- ;
18
- else
19
- company = Leadset.find_or_create_by( company_url: domain )
20
- lead.m3_leadset_id = company.id
21
- lead.save
22
- end
23
- end.compact
24
- =end
25
12
 
26
13
  ##
27
14
  ## 2023-02-26 _vp_ let's go
@@ -73,10 +60,11 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
73
60
  access_key_id: ::S3_CREDENTIALS[:access_key_id],
74
61
  secret_access_key: ::S3_CREDENTIALS[:secret_access_key] })
75
62
 
76
- _mail = client.get_object( bucket: ::S3_CREDENTIALS[:bucket_ses], key: stub.object_key ).body.read
77
- the_mail = Mail.new(_mail)
78
- message_id = the_mail.header['message-id'].decoded
79
- in_reply_to_id = the_mail.header['in-reply-to']&.to_s
63
+ _mail = client.get_object( bucket: ::S3_CREDENTIALS[:bucket_ses], key: stub.object_key ).body.read
64
+ the_mail = Mail.new(_mail)
65
+ message_id = the_mail.header['message-id'].decoded
66
+ in_reply_to_id = the_mail.header['in-reply-to']&.to_s
67
+ email_inbox_tag_id = WpTag.email_inbox_tag.id
80
68
 
81
69
  @message = ::Office::EmailMessage.where( message_id: message_id ).first
82
70
  @message ||= ::Office::EmailMessage.new
@@ -128,7 +116,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
128
116
  conv.update_attributes({
129
117
  state: Conv::STATE_UNREAD,
130
118
  latest_at: the_mail.date,
131
- wp_term_ids: ( [ WpTag.email_inbox_tag.id ] + conv.wp_term_ids + stub.wp_term_ids ).uniq,
119
+ wp_term_ids: ( [ email_inbox_tag_id ] + conv.wp_term_ids + stub.wp_term_ids ).uniq,
132
120
  })
133
121
 
134
122
  ## Leadset
@@ -140,10 +128,6 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
140
128
  conv.lead_ids = conv.lead_ids.push( lead.id ).uniq
141
129
 
142
130
  ## Actions & Filters
143
- # inbox_tag = WpTag.email_inbox_tag
144
- # @message.add_tag( inbox_tag )
145
- # conv.add_tag( inbox_tag )
146
-
147
131
  email_filters = Office::EmailFilter.active
148
132
  email_filters.each do |filter|
149
133
  if @message.from.match( filter.from_regex ) # || @message.part_html.match( filter.body_regex ) ) # || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
@@ -162,7 +146,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
162
146
  stub.update_attributes({ state: ::Office::EmailMessageStub::STATE_PROCESSED })
163
147
 
164
148
  ## Notification
165
- if @message.wp_term_ids.include?( inbox_tag.id )
149
+ if @message.wp_term_ids.include?( email_inbox_tag_id )
166
150
  # @TODO: send android notification _vp_ 2023-03-01
167
151
  ::Ishapi::ApplicationMailer.forwarder_notify( @message.id.to_s ).deliver_later
168
152
  end
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.222
4
+ version: 0.1.8.224
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox