effective_polls 0.6.0 → 0.6.1

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: 1544136785e983f59fec3e24eb2b5f84e2c62bc23afc117c07c79e48707a46bd
4
- data.tar.gz: 37ba582d1fab4f48d064f276b9b4e16dc7a3282fe59d654634cde177185ff9a8
3
+ metadata.gz: 6f0bb62aded7cf4461b6ac474f751db47c9709b0079e39ebfced3aac50327beb
4
+ data.tar.gz: 43c9c7448edee9b0ec1d913187bd28f28c7ca9222494a13f34790ce66f36d40d
5
5
  SHA512:
6
- metadata.gz: 489b7a8ee1acb43014e2fd76386a97bb643b8c4607a3bff709f1e90db3626ffc9369eddd591057f757087eccba86c2dae1a0825f8e35835b92048c2758f3b531
7
- data.tar.gz: e0ed04e867e31649852e68e80fb2fbc1348ca45c852246582258c7627ecd6f5adfa8deb332e3f9f1ce629ccd08f12f0e6695d4202ab5a215e338f4d3976486ce
6
+ metadata.gz: 911327063e49263e213ff7a35243a655e955eacbb9c37d432c9677ab2fc96e2b49066bef2514bd13351c8902691f086e4c00c2f33fed9890223fb3499889fc27
7
+ data.tar.gz: 8bb1b75e904a57867e0f0392be9e8f897c81a9b528f41cc7814f3f99feca0be06503ab0f5b8fd0ca8e2266a974c9722520e2c39b6c5a53cec14661e4750cff5c
@@ -11,7 +11,8 @@ module Effective
11
11
  to: user.email,
12
12
  from: poll_notification.from,
13
13
  body: poll_notification.body,
14
- subject: poll_notification.subject
14
+ subject: poll_notification.subject,
15
+ message_stream: 'broadcast-stream'
15
16
  )
16
17
  end
17
18
 
@@ -22,7 +23,8 @@ module Effective
22
23
  to: user.email,
23
24
  from: poll_notification.from,
24
25
  body: poll_notification.body,
25
- subject: poll_notification.subject
26
+ subject: poll_notification.subject,
27
+ message_stream: 'broadcast-stream'
26
28
  )
27
29
  end
28
30
 
@@ -33,7 +35,8 @@ module Effective
33
35
  to: user.email,
34
36
  from: poll_notification.from,
35
37
  body: poll_notification.body,
36
- subject: poll_notification.subject
38
+ subject: poll_notification.subject,
39
+ message_stream: 'broadcast-stream'
37
40
  )
38
41
  end
39
42
 
@@ -44,7 +47,8 @@ module Effective
44
47
  to: user.email,
45
48
  from: poll_notification.from,
46
49
  body: poll_notification.body,
47
- subject: poll_notification.subject
50
+ subject: poll_notification.subject,
51
+ message_stream: 'broadcast-stream'
48
52
  )
49
53
  end
50
54
 
@@ -55,7 +59,8 @@ module Effective
55
59
  to: user.email,
56
60
  from: poll_notification.from,
57
61
  body: poll_notification.body,
58
- subject: poll_notification.subject
62
+ subject: poll_notification.subject,
63
+ message_stream: 'broadcast-stream'
59
64
  )
60
65
  end
61
66
 
@@ -129,7 +129,9 @@ module Effective
129
129
  end
130
130
  end
131
131
 
132
- def notify!(force: false)
132
+ def notify!(force: false, except: [])
133
+ raise('expected an Array of user IDs') if except.present? && !except.kind_of?(Array)
134
+
133
135
  return false unless (notify_now? || force)
134
136
 
135
137
  # We send to all users, except for the 'Reminder' that exclude completed users
@@ -138,7 +140,17 @@ module Effective
138
140
  update_column(:started_at, Time.zone.now)
139
141
 
140
142
  users.find_each do |user|
141
- Effective::PollsMailer.public_send(email_template, self, user).deliver_now
143
+ print '.'
144
+
145
+ next if except.include?(user.id)
146
+
147
+ begin
148
+ Effective::PollsMailer.public_send(email_template, self, user).deliver_now
149
+ rescue => e
150
+ EffectiveLogger.error(e.message, associated: self) if defined?(EffectiveLogger)
151
+ ExceptionNotifier.notify_exception(e, data: { user_id: user.id }) if defined?(ExceptionNotifier)
152
+ end
153
+
142
154
  end
143
155
 
144
156
  update_column(:completed_at, Time.zone.now)
@@ -1,3 +1,3 @@
1
1
  module EffectivePolls
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_polls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-13 00:00:00.000000000 Z
11
+ date: 2024-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails