notifications-ruby-client 2.3.0 → 2.4.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/.github/PULL_REQUEST_TEMPLATE.md +12 -0
- data/.rspec +1 -0
- data/CHANGELOG.md +7 -0
- data/README.md +10 -4
- data/bin/generate_docker_env.sh +1 -0
- data/bin/test_client.rb +2 -1
- data/lib/notifications/client/speaker.rb +2 -0
- data/lib/notifications/client/version.rb +10 -1
- data/notifications-ruby-client.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db2242bb9327b4033e27f251959d593c4983d654
|
4
|
+
data.tar.gz: ddde90e6a3f27e5cecaf00da9feffc7ec99ade63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7628eebc40595c53bb559420b75cb3e0e0aa9a31bd1198d628e9006c1fb902edd871fe250e516bfbff1c7bdc642d1ff8a6967c22bb807bfafae9804144c62ed2
|
7
|
+
data.tar.gz: 74661018d45151f1375f0af65ab3659be25672808474831fb7f31641eb2533a84578541e05d5db65323929e97b5492c1daa9c2dda1600afdec5123b48f93583f
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!--Thanks for contributing to GOV.UK Notify. Using this template to write your pull request message will help get it merged as soon as possible. -->
|
2
|
+
|
3
|
+
## What problem does the pull request solve?
|
4
|
+
<!--- Describe why you’re making this change -->
|
5
|
+
|
6
|
+
## Checklist
|
7
|
+
|
8
|
+
<!--- All of the following are normally needed. Don’t worry if you haven’t done them or don’t know how – someone from the Notify team will be able to help. -->
|
9
|
+
- [x] I’ve used the pull request template
|
10
|
+
- [ ] I’ve written unit tests for these changes
|
11
|
+
- [ ] I’ve update the documentation (in `README.md`)
|
12
|
+
- [ ] I’ve bumped the version number (in `lib/notifications/client/version.rb`)
|
data/.rspec
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 2.4.0
|
2
|
+
|
3
|
+
### Changed
|
4
|
+
* It is now possible to have multiple SMS senders and to specify which sender an SMS notification should come from. Added the option to specify `sms_sender_id` when using the `send_sms` method. If no `sms_sender_id` is specified, the default sms sender will be used.
|
5
|
+
* Replaced `factory_girl` development dependency with `factory_bot`, which is the [new name for Factory girl.](https://robots.thoughtbot.com/factory_bot)
|
6
|
+
|
7
|
+
|
1
8
|
## 2.3.0
|
2
9
|
|
3
10
|
### Changed
|
data/README.md
CHANGED
@@ -33,9 +33,10 @@ sms = client.send_sms(
|
|
33
33
|
template_id: template_id,
|
34
34
|
personalisation: {
|
35
35
|
name: "name",
|
36
|
-
year: "2016",
|
37
|
-
}
|
38
|
-
reference: "your_reference_string"
|
36
|
+
year: "2016",
|
37
|
+
},
|
38
|
+
reference: "your_reference_string",
|
39
|
+
sms_sender_id: sms_sender_id
|
39
40
|
) # => Notifications::Client::ResponseNotification
|
40
41
|
```
|
41
42
|
|
@@ -136,7 +137,7 @@ email = client.send_email(
|
|
136
137
|
name: "name",
|
137
138
|
year: "2016"
|
138
139
|
},
|
139
|
-
reference: "your_reference_string"
|
140
|
+
reference: "your_reference_string",
|
140
141
|
email_reply_to_id: email_reply_to_id
|
141
142
|
) # => Notifications::Client::ResponseNotification
|
142
143
|
```
|
@@ -359,6 +360,11 @@ An optional identifier you generate. The `reference` can be used as a unique ref
|
|
359
360
|
|
360
361
|
You can omit this argument if you do not require a reference for the notification.
|
361
362
|
|
363
|
+
#### `sms_sender_id`
|
364
|
+
Optional. Specifies the identifier of the sms sender to set for the notification. The identifiers are found in your service Settings, when you 'Manage' your 'Text message sender'.
|
365
|
+
|
366
|
+
If you omit this argument your default sms sender will be set for the notification.
|
367
|
+
|
362
368
|
#### `personalisation`
|
363
369
|
If the template has placeholders you need to provide their values as a Hash, for example:
|
364
370
|
|
data/bin/generate_docker_env.sh
CHANGED
data/bin/test_client.rb
CHANGED
@@ -99,7 +99,8 @@ end
|
|
99
99
|
def test_send_sms_endpoint(client)
|
100
100
|
sms_resp = client.send_sms(phone_number: ENV['FUNCTIONAL_TEST_NUMBER'], template_id: ENV['SMS_TEMPLATE_ID'],
|
101
101
|
personalisation: { "name" => "some name" },
|
102
|
-
reference: "some reference"
|
102
|
+
reference: "some reference",
|
103
|
+
sms_sender_id: ENV['SMS_SENDER_ID'])
|
103
104
|
test_notification_response_data_type(sms_resp, 'sms')
|
104
105
|
sms_resp
|
105
106
|
end
|
@@ -40,6 +40,8 @@ module Notifications
|
|
40
40
|
# Can be an empty string or nil, when you do not require a reference for the notifications.
|
41
41
|
# @option form_data [String] :email_reply_to_id
|
42
42
|
# id of the email address that replies to email notifications will be sent to
|
43
|
+
# @option form_data [String] :sms_sender_id
|
44
|
+
# id of the sender to be used for an sms notification
|
43
45
|
# @see #perform_request!
|
44
46
|
def post(kind, form_data)
|
45
47
|
request = Net::HTTP::Post.new(
|
@@ -1,5 +1,14 @@
|
|
1
|
+
# Version numbering follows Semantic Versionning:
|
2
|
+
#
|
3
|
+
# Given a version number MAJOR.MINOR.PATCH, increment the:
|
4
|
+
# - MAJOR version when you make incompatible API changes,
|
5
|
+
# - MINOR version when you add functionality in a backwards-compatible manner, and
|
6
|
+
# - PATCH version when you make backwards-compatible bug fixes.
|
7
|
+
#
|
8
|
+
# -- http://semver.org/
|
9
|
+
|
1
10
|
module Notifications
|
2
11
|
class Client
|
3
|
-
VERSION = "2.
|
12
|
+
VERSION = "2.4.0".freeze
|
4
13
|
end
|
5
14
|
end
|
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "rake", "~> 12.1"
|
27
27
|
spec.add_development_dependency "rspec", "~> 3.6"
|
28
28
|
spec.add_development_dependency "webmock", "~> 3.1"
|
29
|
-
spec.add_development_dependency "
|
29
|
+
spec.add_development_dependency "factory_bot", "~> 4.8"
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifications-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Government Digital Service
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.1'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: factory_bot
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
@@ -101,6 +101,7 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
104
105
|
- ".gitignore"
|
105
106
|
- ".rspec"
|
106
107
|
- CHANGELOG.md
|