notifications-ruby-client 5.4.0 → 6.2.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 +3 -1
- data/CHANGELOG.md +20 -0
- data/README.md +2 -2
- data/bin/test_client.rb +18 -9
- data/lib/notifications/client/helper_methods.rb +3 -2
- data/lib/notifications/client/notification.rb +4 -0
- data/lib/notifications/client/speaker.rb +2 -0
- data/lib/notifications/client/version.rb +1 -1
- data/notifications-ruby-client.gemspec +1 -1
- metadata +8 -3
- data/DOCUMENTATION.md +0 -1124
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bed01407fc2e19df7f65f9be76877f250bda03e9c7db644bfa86b7d83342f67
|
4
|
+
data.tar.gz: cf02533dcabab2d337aac521e338845d587417d25d238d5bc549feccc99b79e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1f891ddcaf3120c3ab90f01b990178e879c0e785fe27734b017bdaa990a04fc430ed25e5d0b27ed3e6eed5b42a9022fa6dac34e3d7d2ecaae1f2112a6051838
|
7
|
+
data.tar.gz: ea20265635c620d5ee7873e6cce5dd8983db0a3489b4aecb9f09122a4c49d07a3a90f1a1eca1e29bb4bf5df0634e856c67c631c9fc0e416439ceb5976e769876
|
@@ -8,5 +8,7 @@
|
|
8
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
9
|
- [x] I’ve used the pull request template
|
10
10
|
- [ ] I’ve written unit tests for these changes
|
11
|
-
- [ ] I’ve updated the documentation
|
11
|
+
- [ ] I’ve updated the documentation in
|
12
|
+
- [ ] [notifications-tech-docs repository](https://github.com/alphagov/notifications-tech-docs/blob/main/source/documentation/client_docs/_ruby.md)
|
13
|
+
- [ ] `CHANGELOG.md`
|
12
14
|
- [ ] I’ve bumped the version number (in `lib/notifications/client/version.rb`)
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
## 6.2.0
|
2
|
+
* Added fields related to cost data in response:
|
3
|
+
* `is_cost_data_ready`: This field is true if cost data is ready, and false if it isn't (Boolean).
|
4
|
+
* `cost_in_pounds`: Cost of the notification in pounds. The cost does not take free allowance into account (Float).
|
5
|
+
* `cost_details.billable_sms_fragments`: Number of billable SMS fragments in your text message (SMS only) (Integer).
|
6
|
+
* `cost_details.international_rate_multiplier`: For international SMS rate is multiplied by this value (SMS only) (Integer).
|
7
|
+
* `cost_details.sms_rate`: Cost of 1 SMS fragment (SMS only) (Float).
|
8
|
+
* `cost_details.billable_sheets_of_paper`: Number of sheets of paper in the letter you sent, that you will be charged for (letter only) (Integer).
|
9
|
+
* `cost_details.postage`: Postage class of the notification sent (letter only) (String).
|
10
|
+
|
11
|
+
## 6.1.0
|
12
|
+
|
13
|
+
* Adds a `one_click_unsubscribe_url` parameter to `send_email` so services can allow users to easily unsubscribe from distribution lists.
|
14
|
+
* Adds a `one_click_unsubscribe_url` attribute to `Notification` class, so responses for get_notification include the unsubscribe link.
|
15
|
+
|
16
|
+
## 6.0.0
|
17
|
+
|
18
|
+
* Removes the `is_csv` parameter from `prepare_upload`
|
19
|
+
* Adds a `filename` parameter to `prepare_upload` to set the filename of the document upon download. See the documentation for more information.
|
20
|
+
|
1
21
|
## 5.4.0
|
2
22
|
|
3
23
|
* Add support for new security features when sending a file by email:
|
data/README.md
CHANGED
@@ -6,5 +6,5 @@ Useful links:
|
|
6
6
|
|
7
7
|
- [Documentation](https://docs.notifications.service.gov.uk/ruby.html)
|
8
8
|
- [Ruby gem](https://rubygems.org/gems/notifications-ruby-client)
|
9
|
-
- [Changelog](https://github.com/alphagov/notifications-ruby-client/blob/
|
10
|
-
- [Contributing to this client](https://github.com/alphagov/notifications-ruby-client/blob/
|
9
|
+
- [Changelog](https://github.com/alphagov/notifications-ruby-client/blob/main/CHANGELOG.md)
|
10
|
+
- [Contributing to this client](https://github.com/alphagov/notifications-ruby-client/blob/main/CONTRIBUTING.md)
|
data/bin/test_client.rb
CHANGED
@@ -115,11 +115,14 @@ def test_template_preview(response)
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def test_send_email_endpoint(client)
|
118
|
-
email_resp = client.send_email(
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
118
|
+
email_resp = client.send_email(
|
119
|
+
email_address: ENV['FUNCTIONAL_TEST_EMAIL'],
|
120
|
+
template_id: ENV['EMAIL_TEMPLATE_ID'],
|
121
|
+
personalisation: { "name" => "some name" },
|
122
|
+
reference: "some reference",
|
123
|
+
email_reply_to_id: ENV['EMAIL_REPLY_TO_ID'],
|
124
|
+
one_click_unsubscribe_url: "https://www.clovercouncil.gov.uk/unsubscribe?email_address=faye@example.com"
|
125
|
+
)
|
123
126
|
test_notification_response_data_type(email_resp, 'email')
|
124
127
|
email_resp
|
125
128
|
end
|
@@ -130,7 +133,8 @@ def test_send_email_endpoint_with_document(client)
|
|
130
133
|
template_id: ENV['EMAIL_TEMPLATE_ID'],
|
131
134
|
personalisation: { name: Notifications.prepare_upload(f) },
|
132
135
|
reference: "some reference",
|
133
|
-
email_reply_to_id: ENV['EMAIL_REPLY_TO_ID']
|
136
|
+
email_reply_to_id: ENV['EMAIL_REPLY_TO_ID'],
|
137
|
+
one_click_unsubscribe_url: "https://www.clovercouncil.gov.uk/unsubscribe?email_address=faye@example.com")
|
134
138
|
end
|
135
139
|
|
136
140
|
test_notification_response_data_type(email_resp, 'email')
|
@@ -319,7 +323,8 @@ end
|
|
319
323
|
def expected_fields_in_email_content
|
320
324
|
%w(from_email
|
321
325
|
body
|
322
|
-
subject
|
326
|
+
subject
|
327
|
+
one_click_unsubscribe_url)
|
323
328
|
end
|
324
329
|
|
325
330
|
def expected_fields_in_sms_content
|
@@ -342,7 +347,8 @@ def expected_fields_in_email_notification
|
|
342
347
|
template
|
343
348
|
body
|
344
349
|
subject
|
345
|
-
created_at
|
350
|
+
created_at
|
351
|
+
one_click_unsubscribe_url)
|
346
352
|
end
|
347
353
|
|
348
354
|
def expected_fields_in_email_notification_that_are_nil
|
@@ -381,7 +387,8 @@ def expected_fields_in_sms_notification_that_are_nil
|
|
381
387
|
postcode
|
382
388
|
subject
|
383
389
|
created_by_name
|
384
|
-
postage
|
390
|
+
postage
|
391
|
+
one_click_unsubscribe_url)
|
385
392
|
end
|
386
393
|
|
387
394
|
def expected_fields_in_letter_notification
|
@@ -410,6 +417,7 @@ def expected_fields_in_letter_notification_that_are_nil
|
|
410
417
|
line_5
|
411
418
|
line_6
|
412
419
|
created_by_name
|
420
|
+
one_click_unsubscribe_url
|
413
421
|
)
|
414
422
|
end
|
415
423
|
|
@@ -441,6 +449,7 @@ def expected_fields_in_precompiled_letter_notification_that_are_nil
|
|
441
449
|
phone_number
|
442
450
|
postcode
|
443
451
|
sent_at
|
452
|
+
one_click_unsubscribe_url
|
444
453
|
)
|
445
454
|
end
|
446
455
|
|
@@ -1,11 +1,12 @@
|
|
1
1
|
require "base64"
|
2
2
|
|
3
3
|
module Notifications
|
4
|
-
def self.prepare_upload(file,
|
4
|
+
def self.prepare_upload(file, filename: nil, confirm_email_before_download: nil, retention_period: nil)
|
5
5
|
raise ArgumentError.new("File is larger than 2MB") if file.size > Client::MAX_FILE_UPLOAD_SIZE
|
6
6
|
|
7
|
-
data = { file: Base64.strict_encode64(file.read)
|
7
|
+
data = { file: Base64.strict_encode64(file.read) }
|
8
8
|
|
9
|
+
data[:filename] = filename
|
9
10
|
data[:confirm_email_before_download] = confirm_email_before_download
|
10
11
|
data[:retention_period] = retention_period
|
11
12
|
|
@@ -47,6 +47,8 @@ module Notifications
|
|
47
47
|
# id of the email address that replies to email notifications will be sent to
|
48
48
|
# @option form_data [String] :sms_sender_id
|
49
49
|
# id of the sender to be used for an sms notification
|
50
|
+
# @option form_data [String] :one_click_unsubscribe_url
|
51
|
+
# link that end user can click to unsubscribe from the distribution list. We will pass this link in the email headers.
|
50
52
|
# @see #perform_request!
|
51
53
|
def post(kind, form_data)
|
52
54
|
request = Net::HTTP::Post.new(
|
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "rake", "~> 13.0"
|
27
27
|
spec.add_development_dependency "rspec", "~> 3.7"
|
28
28
|
spec.add_development_dependency "webmock", "~> 3.4"
|
29
|
-
spec.add_development_dependency "factory_bot", "~> 6.1"
|
29
|
+
spec.add_development_dependency "factory_bot", "~> 6.1", "<6.4.5"
|
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:
|
4
|
+
version: 6.2.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:
|
11
|
+
date: 2024-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -93,6 +93,9 @@ dependencies:
|
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '6.1'
|
96
|
+
- - "<"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 6.4.5
|
96
99
|
type: :development
|
97
100
|
prerelease: false
|
98
101
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -100,6 +103,9 @@ dependencies:
|
|
100
103
|
- - "~>"
|
101
104
|
- !ruby/object:Gem::Version
|
102
105
|
version: '6.1'
|
106
|
+
- - "<"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 6.4.5
|
103
109
|
description:
|
104
110
|
email:
|
105
111
|
- notify@digital.cabinet-office.gov.uk
|
@@ -114,7 +120,6 @@ files:
|
|
114
120
|
- ".rubocop.yml"
|
115
121
|
- CHANGELOG.md
|
116
122
|
- CONTRIBUTING.md
|
117
|
-
- DOCUMENTATION.md
|
118
123
|
- Dockerfile
|
119
124
|
- Gemfile
|
120
125
|
- LICENSE
|