ishapi 0.1.8.261 → 0.1.8.262

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: 56ee75d806b0386f4ed6711f5dd5ad41ea5e019e390c8fefab935033c3610672
4
+ data.tar.gz: d88e1a906604273915df89242b51414647fad2212b7f517e7994f72c98d095b2
5
5
  SHA512:
6
- metadata.gz: 872225542c8e856b2dc051239b8e9f12270278a40363d66f0dcd0193732c39193fbf03e1d85adc669a31fed9d806107d021dfdce133b5085ed061c52e18156ee
7
- data.tar.gz: 968374933b7f35687e1c68067b7016b2e1856e0c669880e7a289c958f5943c9853fe5a01e36417b253fdb87286ed95e8a5974a01f1e84f4d26346ab602c88857
6
+ metadata.gz: cbd12b11c6ea6e8aebf9ac0989b2b17e964e3dc8534f64e7490a5f985d3069c05b4851986a13036babdc6e883452c25e086f6a428cfcef28ed9814c166a223f1
7
+ data.tar.gz: 13593424d2ee64a60c26bbd225637bae0be4903cfb8249e567b0a2e5b8d1ca218e5abd4f91ce5f4457bfc796c68c55db0d3fe5a212f99ef38d5c78959b7a76dc
@@ -135,26 +135,30 @@ 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 ( @message.from.match( filter.from_regex ) ||
139
+ @message.part_html.match( filter.body_regex ) ||
140
+ @message.subject.match( filter.subject_regex )
141
+ )
140
142
  # || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
143
+
141
144
  @message.apply_filter( filter )
142
145
  end
143
146
  end
144
147
 
145
148
  ## Save to exit
146
149
  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
150
+ # if flag
151
+ # puts! @message.message_id, 'Saved this message'
152
+ # else
153
+ # puts! @message.errors.full_messages.join(', '), 'Cannot save email_message'
154
+ # end
152
155
  conv.save
153
156
  stub.update_attributes({ state: ::Office::EmailMessageStub::STATE_PROCESSED })
154
157
 
155
158
  ## Notification
156
159
  if conv.wp_term_ids.include?( email_inbox_tag_id )
157
- ::Ishapi::ApplicationMailer.forwarder_notify( @message.id.to_s ).deliver_later
160
+ out = ::Ishapi::ApplicationMailer.forwarder_notify( @message.id.to_s )
161
+ Rails.env.production? ? out.deliver_later : out.deliver_now
158
162
  end
159
163
 
160
164
  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.262
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