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 +4 -4
- data/.travis.yml +26 -20
- data/CHANGELOG.md +15 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +93 -85
- data/README.md +44 -8
- data/activity_notification.gemspec +6 -6
- data/gemfiles/Gemfile.rails-4.2 +2 -0
- data/gemfiles/Gemfile.rails-4.2.lock +41 -41
- data/gemfiles/Gemfile.rails-5.0.lock +75 -75
- data/gemfiles/Gemfile.rails-5.1.lock +80 -80
- data/gemfiles/Gemfile.rails-5.2 +18 -0
- data/gemfiles/Gemfile.rails-5.2.lock +242 -0
- data/lib/activity_notification/renderable.rb +9 -5
- data/lib/activity_notification/version.rb +1 -1
- data/lib/generators/templates/controllers/README +2 -2
- data/scripts/bundle_update.sh +7 -0
- data/spec/concerns/models/target_spec.rb +6 -32
- data/spec/concerns/renderable_spec.rb +34 -15
- data/spec/helpers/view_helpers_spec.rb +15 -0
- data/spec/mailers/mailer_spec.rb +1 -1
- data/spec/rails_app/config/application.rb +3 -0
- data/spec/rails_app/config/locales/activity_notification.en.yml +7 -3
- data/spec/rails_app/lib/mailer_previews/mailer_preview.rb +1 -1
- data/spec/roles/acts_as_notifiable_spec.rb +14 -12
- metadata +17 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a06d944af81db724d0db9cea31aecdddfb598a2
|
4
|
+
data.tar.gz: 7ec849e8c659d35be3af4319367db13cd9ca785d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 363b7c13bd8115db1394820d22a468076c5ab4cf93c398f5471a17505fdca52a0dcf0882a7e31d16e4bba1aa2b4b6ddfb64009453c1f7b4745f29fceeafb4ebf
|
7
|
+
data.tar.gz: 129aef5e6feb33fd2c22093f49f791418ec489093fd4d0012bca01019d3cb1a448578d54203f248b846591e1224b31582f4e6c8475c20eadeac4ad4d829ff2b3
|
data/.travis.yml
CHANGED
@@ -5,10 +5,10 @@ branches:
|
|
5
5
|
- images
|
6
6
|
|
7
7
|
rvm:
|
8
|
-
- 2.1
|
9
|
-
- 2.
|
10
|
-
- 2.3.
|
11
|
-
- 2.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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:
|
79
|
+
before_install:
|
80
|
+
- gem install bundler --no-document
|
81
|
+
- rm ${BUNDLE_GEMFILE}.lock
|
76
82
|
|
77
83
|
before_script:
|
78
84
|
- bundle update
|
data/CHANGELOG.md
CHANGED
@@ -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
data/Gemfile.lock
CHANGED
@@ -1,58 +1,62 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
activity_notification (1.
|
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.
|
7
|
+
railties (>= 4.2.0, < 5.3)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actioncable (5.
|
13
|
-
actionpack (= 5.
|
12
|
+
actioncable (5.2.0)
|
13
|
+
actionpack (= 5.2.0)
|
14
14
|
nio4r (~> 2.0)
|
15
|
-
websocket-driver (
|
16
|
-
actionmailer (5.
|
17
|
-
actionpack (= 5.
|
18
|
-
actionview (= 5.
|
19
|
-
activejob (= 5.
|
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.
|
23
|
-
actionview (= 5.
|
24
|
-
activesupport (= 5.
|
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.
|
30
|
-
activesupport (= 5.
|
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.
|
36
|
-
activesupport (= 5.
|
35
|
+
activejob (5.2.0)
|
36
|
+
activesupport (= 5.2.0)
|
37
37
|
globalid (>= 0.3.6)
|
38
|
-
activemodel (5.
|
39
|
-
activesupport (= 5.
|
40
|
-
activerecord (5.
|
41
|
-
activemodel (= 5.
|
42
|
-
activesupport (= 5.
|
43
|
-
arel (
|
44
|
-
|
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 (
|
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 (
|
54
|
-
aws-partitions (1.
|
55
|
-
aws-sdk-core (3.
|
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.
|
68
|
+
bson (4.3.0)
|
65
69
|
builder (3.2.3)
|
66
|
-
bullet (5.
|
70
|
+
bullet (5.7.5)
|
67
71
|
activesupport (>= 3.0.0)
|
68
|
-
uniform_notifier (~> 1.
|
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.
|
77
|
-
devise (4.3
|
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, <
|
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.
|
86
|
-
dotenv-rails (2.
|
87
|
-
dotenv (= 2.
|
88
|
-
railties (>= 3.2, <
|
89
|
-
erubi (1.7.
|
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.
|
101
|
+
i18n (1.0.1)
|
98
102
|
concurrent-ruby (~> 1.0)
|
99
|
-
jmespath (1.
|
100
|
-
jquery-rails (4.3.
|
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.
|
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.
|
114
|
-
mongo (2.
|
115
|
-
bson (>= 4.
|
116
|
-
mongoid (
|
117
|
-
activemodel (
|
118
|
-
mongo (>= 2.
|
119
|
-
mysql2 (0.
|
120
|
-
nio4r (2.1
|
121
|
-
nokogiri (1.8.
|
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.
|
125
|
-
rack (2.0.
|
126
|
-
rack-test (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.
|
129
|
-
actioncable (= 5.
|
130
|
-
actionmailer (= 5.
|
131
|
-
actionpack (= 5.
|
132
|
-
actionview (= 5.
|
133
|
-
activejob (= 5.
|
134
|
-
activemodel (= 5.
|
135
|
-
activerecord (= 5.
|
136
|
-
|
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.
|
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.
|
148
|
-
loofah (~> 2.
|
149
|
-
railties (5.
|
150
|
-
actionpack (= 5.
|
151
|
-
activesupport (= 5.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
196
|
-
tzinfo (1.2.
|
203
|
+
tins (1.16.3)
|
204
|
+
tzinfo (1.2.5)
|
197
205
|
thread_safe (~> 0.1)
|
198
|
-
uniform_notifier (1.
|
206
|
+
uniform_notifier (1.11.0)
|
199
207
|
warden (1.2.7)
|
200
208
|
rack (>= 1.0)
|
201
|
-
websocket-driver (0.
|
209
|
+
websocket-driver (0.7.0)
|
202
210
|
websocket-extensions (>= 0.1.0)
|
203
211
|
websocket-extensions (0.1.3)
|
204
|
-
yard (0.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
|
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.
|
222
|
-
pg (~> 0.
|
223
|
-
rails (~> 5.
|
229
|
+
mysql2 (~> 0.5.1)
|
230
|
+
pg (~> 1.0.0)
|
231
|
+
rails (~> 5.2)
|
224
232
|
rails-controller-testing
|
225
|
-
rspec-rails (~> 3.7.
|
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.
|
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:
|
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
|
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/
|
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/
|
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
|