activity_notification 1.4.4 → 1.5.0

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
  SHA1:
3
- metadata.gz: 46b381fdf338d9e13613c5810474c548c37e74fc
4
- data.tar.gz: 65349dbb5ded639020892a97a3046f2ce602e339
3
+ metadata.gz: 2a06d944af81db724d0db9cea31aecdddfb598a2
4
+ data.tar.gz: 7ec849e8c659d35be3af4319367db13cd9ca785d
5
5
  SHA512:
6
- metadata.gz: 27bfed45216134b7f054a513d306dc2e63fcb2083a25dbed40191a069644381d508b30028e7325531094319b6cf936df38bedc075e487ac18b858e2d5999bc7e
7
- data.tar.gz: 478f4c8bf51dc05184fc81bee6a887cc029c11dfc66084fcc99b26f805f854f71b6d8540f80796d8df02f34f671fea278f7b28e895fcccf0f31e38791d1f41e1
6
+ metadata.gz: 363b7c13bd8115db1394820d22a468076c5ab4cf93c398f5471a17505fdca52a0dcf0882a7e31d16e4bba1aa2b4b6ddfb64009453c1f7b4745f29fceeafb4ebf
7
+ data.tar.gz: 129aef5e6feb33fd2c22093f49f791418ec489093fd4d0012bca01019d3cb1a448578d54203f248b846591e1224b31582f4e6c8475c20eadeac4ad4d829ff2b3
@@ -5,10 +5,10 @@ branches:
5
5
  - images
6
6
 
7
7
  rvm:
8
- - 2.1.10
9
- - 2.2.7
10
- - 2.3.4
11
- - 2.4.1
8
+ - 2.5.1
9
+ - 2.4.4
10
+ - 2.3.7
11
+ - 2.2.10
12
12
  - ruby-head
13
13
 
14
14
  gemfile:
@@ -16,6 +16,7 @@ gemfile:
16
16
  - gemfiles/Gemfile.rails-4.2
17
17
  - gemfiles/Gemfile.rails-5.0
18
18
  - gemfiles/Gemfile.rails-5.1
19
+ - gemfiles/Gemfile.rails-5.2
19
20
 
20
21
  env:
21
22
  - AN_ORM=active_record
@@ -23,44 +24,47 @@ env:
23
24
 
24
25
  matrix:
25
26
  exclude:
26
- - rvm: 2.1.10
27
- gemfile: Gemfile
28
- - rvm: 2.1.10
29
- gemfile: gemfiles/Gemfile.rails-5.0
30
- - rvm: 2.1.10
31
- gemfile: gemfiles/Gemfile.rails-5.1
32
27
  - rvm: ruby-head
33
28
  env: AN_ORM=mongoid
34
29
  - gemfile: Gemfile
35
30
  env: AN_ORM=mongoid
36
31
  include:
37
- - rvm: 2.4.1
32
+ - rvm: 2.5.1
38
33
  gemfile: gemfiles/Gemfile.rails-4.2
39
34
  env: AN_ORM=active_record AN_TEST_DB=mysql
40
- - rvm: 2.4.1
35
+ - rvm: 2.5.1
41
36
  gemfile: gemfiles/Gemfile.rails-4.2
42
37
  env: AN_ORM=active_record AN_TEST_DB=postgresql
43
- - rvm: 2.4.1
38
+ - rvm: 2.5.1
44
39
  gemfile: gemfiles/Gemfile.rails-4.2
45
40
  env: AN_ORM=mongoid AN_TEST_DB=mongodb
46
- - rvm: 2.4.1
41
+ - rvm: 2.5.1
47
42
  gemfile: gemfiles/Gemfile.rails-5.0
48
43
  env: AN_ORM=active_record AN_TEST_DB=mysql
49
- - rvm: 2.4.1
44
+ - rvm: 2.5.1
50
45
  gemfile: gemfiles/Gemfile.rails-5.0
51
46
  env: AN_ORM=active_record AN_TEST_DB=postgresql
52
- - rvm: 2.4.1
47
+ - rvm: 2.5.1
53
48
  gemfile: gemfiles/Gemfile.rails-5.0
54
49
  env: AN_ORM=mongoid AN_TEST_DB=mongodb
55
- - rvm: 2.4.1
50
+ - rvm: 2.5.1
56
51
  gemfile: gemfiles/Gemfile.rails-5.1
57
52
  env: AN_ORM=active_record AN_TEST_DB=mysql
58
- - rvm: 2.4.1
53
+ - rvm: 2.5.1
59
54
  gemfile: gemfiles/Gemfile.rails-5.1
60
55
  env: AN_ORM=active_record AN_TEST_DB=postgresql
61
- - rvm: 2.4.1
56
+ - rvm: 2.5.1
62
57
  gemfile: gemfiles/Gemfile.rails-5.1
63
58
  env: AN_ORM=mongoid AN_TEST_DB=mongodb
59
+ - rvm: 2.5.1
60
+ gemfile: gemfiles/Gemfile.rails-5.2
61
+ env: AN_ORM=active_record AN_TEST_DB=mysql
62
+ - rvm: 2.5.1
63
+ gemfile: gemfiles/Gemfile.rails-5.2
64
+ env: AN_ORM=active_record AN_TEST_DB=postgresql
65
+ - rvm: 2.5.1
66
+ gemfile: gemfiles/Gemfile.rails-5.2
67
+ env: AN_ORM=mongoid AN_TEST_DB=mongodb
64
68
  allow_failures:
65
69
  - rvm: ruby-head
66
70
  fast_finish: true
@@ -72,7 +76,9 @@ sudo: false
72
76
 
73
77
  cache: bundler
74
78
 
75
- before_install: "rm ${BUNDLE_GEMFILE}.lock"
79
+ before_install:
80
+ - gem install bundler --no-document
81
+ - rm ${BUNDLE_GEMFILE}.lock
76
82
 
77
83
  before_script:
78
84
  - bundle update
@@ -1,3 +1,18 @@
1
+ ## 1.5.0 / 2018-05-05
2
+ [Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.4.4...v1.5.0)
3
+
4
+ Enhancements:
5
+
6
+ * Allow use with Rails 5.2
7
+ * Enhancements for using the gem with i18n
8
+ * Symbolize parameters for i18n interpolation
9
+ * Allow pluralization in i18n translation
10
+ * Update render method to use plain
11
+
12
+ Bug Fixes:
13
+
14
+ * Fix a doc bug for controllers template
15
+
1
16
  ## 1.4.4 / 2017-11-18
2
17
  [Full Changelog](http://github.com/simukappu/activity_notification/compare/v1.4.3...v1.4.4)
3
18
 
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rails', '~> 5.1'
5
+ gem 'rails', '~> 5.2'
6
6
 
7
7
  group :development do
8
8
  gem 'bullet'
@@ -1,58 +1,62 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activity_notification (1.4.4)
4
+ activity_notification (1.5.0)
5
5
  i18n (>= 0.5.0)
6
6
  jquery-rails (>= 3.1.1)
7
- railties (>= 4.2.0, < 5.2)
7
+ railties (>= 4.2.0, < 5.3)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (5.1.4)
13
- actionpack (= 5.1.4)
12
+ actioncable (5.2.0)
13
+ actionpack (= 5.2.0)
14
14
  nio4r (~> 2.0)
15
- websocket-driver (~> 0.6.1)
16
- actionmailer (5.1.4)
17
- actionpack (= 5.1.4)
18
- actionview (= 5.1.4)
19
- activejob (= 5.1.4)
15
+ websocket-driver (>= 0.6.1)
16
+ actionmailer (5.2.0)
17
+ actionpack (= 5.2.0)
18
+ actionview (= 5.2.0)
19
+ activejob (= 5.2.0)
20
20
  mail (~> 2.5, >= 2.5.4)
21
21
  rails-dom-testing (~> 2.0)
22
- actionpack (5.1.4)
23
- actionview (= 5.1.4)
24
- activesupport (= 5.1.4)
22
+ actionpack (5.2.0)
23
+ actionview (= 5.2.0)
24
+ activesupport (= 5.2.0)
25
25
  rack (~> 2.0)
26
26
  rack-test (>= 0.6.3)
27
27
  rails-dom-testing (~> 2.0)
28
28
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.1.4)
30
- activesupport (= 5.1.4)
29
+ actionview (5.2.0)
30
+ activesupport (= 5.2.0)
31
31
  builder (~> 3.1)
32
32
  erubi (~> 1.4)
33
33
  rails-dom-testing (~> 2.0)
34
34
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.1.4)
36
- activesupport (= 5.1.4)
35
+ activejob (5.2.0)
36
+ activesupport (= 5.2.0)
37
37
  globalid (>= 0.3.6)
38
- activemodel (5.1.4)
39
- activesupport (= 5.1.4)
40
- activerecord (5.1.4)
41
- activemodel (= 5.1.4)
42
- activesupport (= 5.1.4)
43
- arel (~> 8.0)
44
- activesupport (5.1.4)
38
+ activemodel (5.2.0)
39
+ activesupport (= 5.2.0)
40
+ activerecord (5.2.0)
41
+ activemodel (= 5.2.0)
42
+ activesupport (= 5.2.0)
43
+ arel (>= 9.0)
44
+ activestorage (5.2.0)
45
+ actionpack (= 5.2.0)
46
+ activerecord (= 5.2.0)
47
+ marcel (~> 0.3.1)
48
+ activesupport (5.2.0)
45
49
  concurrent-ruby (~> 1.0, >= 1.0.2)
46
- i18n (~> 0.7)
50
+ i18n (>= 0.7, < 2)
47
51
  minitest (~> 5.1)
48
52
  tzinfo (~> 1.1)
49
53
  ammeter (1.1.4)
50
54
  activesupport (>= 3.0)
51
55
  railties (>= 3.0)
52
56
  rspec-rails (>= 2.2)
53
- arel (8.0.0)
54
- aws-partitions (1.36.0)
55
- aws-sdk-core (3.7.0)
57
+ arel (9.0.0)
58
+ aws-partitions (1.83.0)
59
+ aws-sdk-core (3.20.2)
56
60
  aws-partitions (~> 1.0)
57
61
  aws-sigv4 (~> 1.0)
58
62
  jmespath (~> 1.0)
@@ -61,11 +65,11 @@ GEM
61
65
  aws-sigv4 (~> 1.0)
62
66
  aws-sigv4 (1.0.2)
63
67
  bcrypt (3.1.11)
64
- bson (4.2.2)
68
+ bson (4.3.0)
65
69
  builder (3.2.3)
66
- bullet (5.6.1)
70
+ bullet (5.7.5)
67
71
  activesupport (>= 3.0.0)
68
- uniform_notifier (~> 1.10.0)
72
+ uniform_notifier (~> 1.11.0)
69
73
  concurrent-ruby (1.0.5)
70
74
  coveralls (0.8.21)
71
75
  json (>= 1.8, < 3)
@@ -73,20 +77,20 @@ GEM
73
77
  term-ansicolor (~> 1.3)
74
78
  thor (~> 0.19.4)
75
79
  tins (~> 1.6)
76
- crass (1.0.3)
77
- devise (4.3.0)
80
+ crass (1.0.4)
81
+ devise (4.4.3)
78
82
  bcrypt (~> 3.0)
79
83
  orm_adapter (~> 0.1)
80
- railties (>= 4.1.0, < 5.2)
84
+ railties (>= 4.1.0, < 6.0)
81
85
  responders
82
86
  warden (~> 1.2.3)
83
87
  diff-lcs (1.3)
84
88
  docile (1.1.5)
85
- dotenv (2.2.1)
86
- dotenv-rails (2.2.1)
87
- dotenv (= 2.2.1)
88
- railties (>= 3.2, < 5.2)
89
- erubi (1.7.0)
89
+ dotenv (2.4.0)
90
+ dotenv-rails (2.4.0)
91
+ dotenv (= 2.4.0)
92
+ railties (>= 3.2, < 6.0)
93
+ erubi (1.7.1)
90
94
  factory_bot (4.8.2)
91
95
  activesupport (>= 3.0.0)
92
96
  factory_bot_rails (4.8.2)
@@ -94,48 +98,52 @@ GEM
94
98
  railties (>= 3.0.0)
95
99
  globalid (0.4.1)
96
100
  activesupport (>= 4.2.0)
97
- i18n (0.9.1)
101
+ i18n (1.0.1)
98
102
  concurrent-ruby (~> 1.0)
99
- jmespath (1.3.1)
100
- jquery-rails (4.3.1)
103
+ jmespath (1.4.0)
104
+ jquery-rails (4.3.3)
101
105
  rails-dom-testing (>= 1, < 3)
102
106
  railties (>= 4.2.0)
103
107
  thor (>= 0.14, < 2.0)
104
108
  json (2.1.0)
105
- loofah (2.1.1)
109
+ loofah (2.2.2)
106
110
  crass (~> 1.0.2)
107
111
  nokogiri (>= 1.5.9)
108
112
  mail (2.7.0)
109
113
  mini_mime (>= 0.1.1)
114
+ marcel (0.3.2)
115
+ mimemagic (~> 0.3.2)
110
116
  method_source (0.9.0)
117
+ mimemagic (0.3.2)
111
118
  mini_mime (1.0.0)
112
119
  mini_portile2 (2.3.0)
113
- minitest (5.10.3)
114
- mongo (2.4.3)
115
- bson (>= 4.2.1, < 5.0.0)
116
- mongoid (6.2.1)
117
- activemodel (~> 5.1)
118
- mongo (>= 2.4.1, < 3.0.0)
119
- mysql2 (0.4.10)
120
- nio4r (2.1.0)
121
- nokogiri (1.8.1)
120
+ minitest (5.11.3)
121
+ mongo (2.5.3)
122
+ bson (>= 4.3.0, < 5.0.0)
123
+ mongoid (7.0.1)
124
+ activemodel (>= 5.1, < 6.0.0)
125
+ mongo (>= 2.5.1, < 3.0.0)
126
+ mysql2 (0.5.1)
127
+ nio4r (2.3.1)
128
+ nokogiri (1.8.2)
122
129
  mini_portile2 (~> 2.3.0)
123
130
  orm_adapter (0.5.0)
124
- pg (0.21.0)
125
- rack (2.0.3)
126
- rack-test (0.7.0)
131
+ pg (1.0.0)
132
+ rack (2.0.5)
133
+ rack-test (1.0.0)
127
134
  rack (>= 1.0, < 3)
128
- rails (5.1.4)
129
- actioncable (= 5.1.4)
130
- actionmailer (= 5.1.4)
131
- actionpack (= 5.1.4)
132
- actionview (= 5.1.4)
133
- activejob (= 5.1.4)
134
- activemodel (= 5.1.4)
135
- activerecord (= 5.1.4)
136
- activesupport (= 5.1.4)
135
+ rails (5.2.0)
136
+ actioncable (= 5.2.0)
137
+ actionmailer (= 5.2.0)
138
+ actionpack (= 5.2.0)
139
+ actionview (= 5.2.0)
140
+ activejob (= 5.2.0)
141
+ activemodel (= 5.2.0)
142
+ activerecord (= 5.2.0)
143
+ activestorage (= 5.2.0)
144
+ activesupport (= 5.2.0)
137
145
  bundler (>= 1.3.0)
138
- railties (= 5.1.4)
146
+ railties (= 5.2.0)
139
147
  sprockets-rails (>= 2.0.0)
140
148
  rails-controller-testing (1.0.2)
141
149
  actionpack (~> 5.x, >= 5.0.1)
@@ -144,19 +152,19 @@ GEM
144
152
  rails-dom-testing (2.0.3)
145
153
  activesupport (>= 4.2.0)
146
154
  nokogiri (>= 1.6)
147
- rails-html-sanitizer (1.0.3)
148
- loofah (~> 2.0)
149
- railties (5.1.4)
150
- actionpack (= 5.1.4)
151
- activesupport (= 5.1.4)
155
+ rails-html-sanitizer (1.0.4)
156
+ loofah (~> 2.2, >= 2.2.2)
157
+ railties (5.2.0)
158
+ actionpack (= 5.2.0)
159
+ activesupport (= 5.2.0)
152
160
  method_source
153
161
  rake (>= 0.8.7)
154
162
  thor (>= 0.18.1, < 2.0)
155
- rake (12.3.0)
163
+ rake (12.3.1)
156
164
  responders (2.4.0)
157
165
  actionpack (>= 4.2.0, < 5.3)
158
166
  railties (>= 4.2.0, < 5.3)
159
- rspec-core (3.7.0)
167
+ rspec-core (3.7.1)
160
168
  rspec-support (~> 3.7.0)
161
169
  rspec-expectations (3.7.0)
162
170
  diff-lcs (>= 1.2.0, < 2.0)
@@ -164,7 +172,7 @@ GEM
164
172
  rspec-mocks (3.7.0)
165
173
  diff-lcs (>= 1.2.0, < 2.0)
166
174
  rspec-support (~> 3.7.0)
167
- rspec-rails (3.7.1)
175
+ rspec-rails (3.7.2)
168
176
  actionpack (>= 3.0)
169
177
  activesupport (>= 3.0)
170
178
  railties (>= 3.0)
@@ -172,13 +180,13 @@ GEM
172
180
  rspec-expectations (~> 3.7.0)
173
181
  rspec-mocks (~> 3.7.0)
174
182
  rspec-support (~> 3.7.0)
175
- rspec-support (3.7.0)
183
+ rspec-support (3.7.1)
176
184
  simplecov (0.14.1)
177
185
  docile (~> 1.1.0)
178
186
  json (>= 1.8, < 3)
179
187
  simplecov-html (~> 0.10.0)
180
188
  simplecov-html (0.10.2)
181
- slack-notifier (2.3.1)
189
+ slack-notifier (2.3.2)
182
190
  sprockets (3.7.1)
183
191
  concurrent-ruby (~> 1.0)
184
192
  rack (> 1, < 3)
@@ -192,16 +200,16 @@ GEM
192
200
  thor (0.19.4)
193
201
  thread_safe (0.3.6)
194
202
  timecop (0.9.1)
195
- tins (1.15.1)
196
- tzinfo (1.2.4)
203
+ tins (1.16.3)
204
+ tzinfo (1.2.5)
197
205
  thread_safe (~> 0.1)
198
- uniform_notifier (1.10.0)
206
+ uniform_notifier (1.11.0)
199
207
  warden (1.2.7)
200
208
  rack (>= 1.0)
201
- websocket-driver (0.6.5)
209
+ websocket-driver (0.7.0)
202
210
  websocket-extensions (>= 0.1.0)
203
211
  websocket-extensions (0.1.3)
204
- yard (0.9.9)
212
+ yard (0.9.12)
205
213
  yard-activesupport-concern (0.0.1)
206
214
  yard (>= 0.8)
207
215
 
@@ -214,20 +222,20 @@ DEPENDENCIES
214
222
  aws-sdk-sns (~> 1)
215
223
  bullet
216
224
  coveralls
217
- devise (~> 4.3.0)
225
+ devise (~> 4.4.3)
218
226
  dotenv-rails
219
227
  factory_bot_rails (~> 4.8.2)
220
228
  mongoid (>= 4.0.0)
221
- mysql2 (~> 0.4.10)
222
- pg (~> 0.21.0)
223
- rails (~> 5.1)
229
+ mysql2 (~> 0.5.1)
230
+ pg (~> 1.0.0)
231
+ rails (~> 5.2)
224
232
  rails-controller-testing
225
- rspec-rails (~> 3.7.1)
233
+ rspec-rails (~> 3.7.2)
226
234
  simplecov (~> 0)
227
235
  slack-notifier (>= 1.5.1)
228
236
  sqlite3 (~> 1.3.13)
229
237
  timecop
230
- yard (~> 0.9.9)
238
+ yard (~> 0.9.12)
231
239
  yard-activesupport-concern (~> 0.0.1)
232
240
 
233
241
  BUNDLED WITH
data/README.md CHANGED
@@ -69,10 +69,12 @@
69
69
  - [Functions](#functions)
70
70
  - [Email notification](#email-notification)
71
71
  - [Mailer setup](#mailer-setup)
72
+ - [Sender configuration](#sender-configuration)
72
73
  - [Email templates](#email-templates)
73
74
  - [i18n for email](#i18n-for-email)
74
75
  - [Batch email notification](#batch-email-notification)
75
76
  - [Batch mailer setup](#batch-mailer-setup)
77
+ - [Batch sender configuration](#batch-sender-configuration)
76
78
  - [Batch email templates](#batch-email-templates)
77
79
  - [i18n for batch email](#i18n-for-batch-email)
78
80
  - [Grouping notifications](#grouping-notifications)
@@ -505,20 +507,25 @@ notification:
505
507
  article:
506
508
  create:
507
509
  text: 'Article has been created'
510
+ update:
511
+ text: 'Article %{article_title} has been updated'
508
512
  destroy:
509
513
  text: 'Some user removed an article!'
510
514
  comment:
511
515
  post:
512
- text: "<p>%{notifier_name} posted comments to your article %{article_title}</p>"
516
+ text:
517
+ one: "<p>%{notifier_name} posted a comment on your article %{article_title}</p>"
518
+ other: "<p>%{notifier_name} posted %{count} comments on your article %{article_title}</p>"
513
519
  reply:
514
- text: "<p>%{notifier_name} and %{group_member_count} other users replied for your comments</p>"
520
+ text: "<p>%{notifier_name} and %{group_member_count} other people replied %{group_notification_count} times to your comment</p>"
521
+ mail_subject: 'New comment on your article'
515
522
  admin:
516
523
  article:
517
524
  post:
518
525
  text: '[Admin] Article has been created'
519
526
  ```
520
527
 
521
- This structure is valid for notifications with keys *"notification.comment.reply"* or *"comment.reply"*. As mentioned before, *"notification."* part of the key is optional. In addition for above example, `%{notifier_name}` and `%{article_title}` are used from parameter field in the notification record.
528
+ This structure is valid for notifications with keys *"notification.comment.reply"* or *"comment.reply"*. As mentioned before, *"notification."* part of the key is optional. In addition for above example, `%{notifier_name}` and `%{article_title}` are used from parameter field in the notification record. Pluralization is supported (but optional) for grouped notifications using the `%{group_notification_count}` value.
522
529
 
523
530
  ### Customizing controllers (optional)
524
531
 
@@ -594,7 +601,6 @@ Email notification is disabled as default. You can configure to enable email not
594
601
 
595
602
  ```ruby
596
603
  config.email_enabled = true
597
- config.mailer_sender = 'your_notification_sender@example.com'
598
604
  ```
599
605
 
600
606
  You can also configure them for each model by *acts_as roles* like these.
@@ -626,6 +632,22 @@ class Comment < ActiveRecord::Base
626
632
  end
627
633
  ```
628
634
 
635
+ #### Sender configuration
636
+
637
+ You can configure the notification *"from"* address inside of *activity_notification.rb* in two ways.
638
+
639
+ Using a simple email address as *String*:
640
+
641
+ ```ruby
642
+ config.mailer_sender = 'your_notification_sender@example.com'
643
+ ```
644
+
645
+ Using a *Proc* to configure the sender based on the *notification.key*:
646
+
647
+ ```ruby
648
+ config.mailer_sender = ->(key){ key == 'inquiry.post' ? 'support@example.com' : 'noreply@example.com' }
649
+ ```
650
+
629
651
  #### Email templates
630
652
 
631
653
  *activity_notification* will look for email template in the same way as notification views. For example, if you have a notification with *:key* set to *"notification.comment.reply"* and target_type *users*, the gem will look for a partial in *app/views/activity_notification/mailer/users/comment/_reply.html.(|erb|haml|slim|something_else)*.
@@ -657,7 +679,6 @@ Batch email notification is disabled as default. You can configure to enable ema
657
679
 
658
680
  ```ruby
659
681
  config.email_enabled = true
660
- config.mailer_sender = 'your_notification_sender@example.com'
661
682
  ```
662
683
 
663
684
  You can also configure them for each target model by *acts_as_target* role like this.
@@ -684,10 +705,20 @@ You can also add conditions to filter notifications, like this:
684
705
  User.send_batch_unopened_notification_email(batch_key: 'batch.comment.post', filtered_by_key: 'comment.post', custom_filter: ["created_at >= ?", time.hour.ago])
685
706
  ```
686
707
 
708
+ #### Batch sender configuration
709
+
710
+ *activity_notification* uses same sender configuration of real-time email notification as batch email sender.
711
+ You can configure *config.mailer_sender* as simply *String* or *Proc* based on the *batch_key*:
712
+
713
+ ```ruby
714
+ config.mailer_sender = ->(batch_key){ batch_key == 'batch.inquiry.post' ? 'support@example.com' : 'noreply@example.com' }
715
+ ```
716
+
717
+ *batch_key* is specified by **:batch_key** option. If this option is not specified, the key of the first notification will be used as *batch_key*.
718
+
687
719
  #### Batch email templates
688
720
 
689
721
  *activity_notification* will look for batch email template in the same way as email notification using *batch_key*.
690
- *batch_key* is specified by **:batch_key** option. If this option is not specified, the key of the first notification will be used as *batch_key*.
691
722
 
692
723
  #### i18n for batch email
693
724
 
@@ -970,14 +1001,19 @@ The gem will also look for templates whose *<target_class_name>* is *default*, *
970
1001
 
971
1002
  *activity_notification* provides **ActivityNotification::OptionalTarget::AmazonSNS** as default optional target implementation for Amazon SNS.
972
1003
 
973
- First, add **aws-sdk** gem to your Gemfile and set AWS Credentials for SDK (See [Configuring the AWS SDK for Ruby](https://docs.aws.amazon.com/sdk-for-ruby/v2/developer-guide/setup-config.html)).
1004
+ First, add **aws-sdk** or **aws-sdk-sns** (>= AWS SDK for Ruby v3) gem to your Gemfile and set AWS Credentials for SDK (See [Configuring the AWS SDK for Ruby](https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-config.html)).
974
1005
 
975
1006
  ```ruby
976
1007
  gem 'aws-sdk', '~> 2'
1008
+ # --- or ---
1009
+ gem 'aws-sdk-sns', '~> 1'
977
1010
  ```
978
1011
 
979
1012
  ```ruby
980
1013
  require 'aws-sdk'
1014
+ # --- or ---
1015
+ require 'aws-sdk-sns'
1016
+
981
1017
  Aws.config.update(
982
1018
  region: 'your_region',
983
1019
  credentials: Aws::Credentials.new('your_access_key_id', 'your_secret_access_key')
@@ -985,7 +1021,7 @@ Aws.config.update(
985
1021
  ```
986
1022
 
987
1023
  Then, write `require 'activity_notification/optional_targets/amazon_sns'` statement in your notifiable model and set *ActivityNotification::OptionalTarget::AmazonSNS* to *acts_as_notifiable* with *:topic_arn*, *:target_arn* or *:phone_number* initializing parameters.
988
- Any other options for `Aws::SNS::Client.new` are available as initializing parameters. See [API Reference of Class: Aws::SNS::Client](http://docs.aws.amazon.com/sdkforruby/api/Aws/SNS/Client.html) for more details.
1024
+ Any other options for `Aws::SNS::Client.new` are available as initializing parameters. See [API Reference of Class: Aws::SNS::Client](http://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SNS/Client.html) for more details.
989
1025
 
990
1026
  ```ruby
991
1027
  class Comment < ActiveRecord::Base