ishapi 0.1.8.261 → 0.1.8.263

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: cdfc935db986bd71cf03133c0864029fd49a5270bac5e0abe167a20acc7e1ad7
4
- data.tar.gz: 15e3e9a2664b32dba18baf4468724b1c31accb2131598f1c574d93dfc202abab
3
+ metadata.gz: 6ab645179f5378ac422a64f86bf835cfd005a3d1e1e68400d0981fea74c77d6a
4
+ data.tar.gz: 0735c8adcc43ab9cad6ec1ec1b0c9844b3a2d85cec5b53167a2105db69638fa7
5
5
  SHA512:
6
- metadata.gz: 872225542c8e856b2dc051239b8e9f12270278a40363d66f0dcd0193732c39193fbf03e1d85adc669a31fed9d806107d021dfdce133b5085ed061c52e18156ee
7
- data.tar.gz: 968374933b7f35687e1c68067b7016b2e1856e0c669880e7a289c958f5943c9853fe5a01e36417b253fdb87286ed95e8a5974a01f1e84f4d26346ab602c88857
6
+ metadata.gz: 683aa847832ad85b51d707e95bbdf7b11bd7dcfaa5357838bf29e604da00362afed580ebdeca4169d05a0f9071c407e5e6fb04d7632793cd739ea61241482240
7
+ data.tar.gz: 8646b7b57233b084c914ea8e48bddc627d16176b15d23932920820e6f702c2b9e356b994a426ae456869ce6004e95c2fbeaf3421536b68368567ddf7db181eeb
@@ -135,26 +135,29 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
135
135
  ## Actions & Filters
136
136
  email_filters = Office::EmailFilter.active
137
137
  email_filters.each do |filter|
138
- if @message.from.match( filter.from_regex )
139
- # || @message.part_html.match( filter.body_regex ) )
138
+ if ( filter.from_regex.blank? || @message.from.match( filter.from_regex ) ) &&
139
+ ( filter.body_regex.blank? || @message.part_html.match( filter.body_regex ) ) &&
140
+ ( filter.subject_regex.blank? || @message.subject.match( filter.subject_regex ) )
140
141
  # || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
142
+
141
143
  @message.apply_filter( filter )
142
144
  end
143
145
  end
144
146
 
145
147
  ## Save to exit
146
148
  flag = @message.save
147
- if flag
148
- puts! @message.message_id, 'Saved this message'
149
- else
150
- puts! @message.errors.full_messages.join(', '), 'Cannot save email_message'
151
- end
149
+ # if flag
150
+ # puts! @message.message_id, 'Saved this message'
151
+ # else
152
+ # puts! @message.errors.full_messages.join(', '), 'Cannot save email_message'
153
+ # end
152
154
  conv.save
153
155
  stub.update_attributes({ state: ::Office::EmailMessageStub::STATE_PROCESSED })
154
156
 
155
157
  ## Notification
156
158
  if conv.wp_term_ids.include?( email_inbox_tag_id )
157
- ::Ishapi::ApplicationMailer.forwarder_notify( @message.id.to_s ).deliver_later
159
+ out = ::Ishapi::ApplicationMailer.forwarder_notify( @message.id.to_s )
160
+ Rails.env.production? ? out.deliver_later : out.deliver_now
158
161
  end
159
162
 
160
163
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.261
4
+ version: 0.1.8.263
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-03 00:00:00.000000000 Z
11
+ date: 2023-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails