Skip to content

Commit

Permalink
Rename unsubscribe_link to one_click_unsubscribe_url
Browse files Browse the repository at this point in the history
  • Loading branch information
quis committed May 15, 2024
1 parent b7ceabc commit 8bfc9ce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## 6.1.0

* Adds a `unsubscribe_link` parameter to `send_email` so services can allow users to easily unsubscribe from distribution lists.
* Adds a `unsubscribe_link` attribute to `Notification` class, so responses for get_notification include the unsubscribe link.
* Adds a `one_click_unsubscribe_url` parameter to `send_email` so services can allow users to easily unsubscribe from distribution lists.
* Adds a `one_click_unsubscribe_url` attribute to `Notification` class, so responses for get_notification include the unsubscribe link.

## 6.0.0

Expand Down
14 changes: 7 additions & 7 deletions bin/test_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def test_send_email_endpoint(client)
personalisation: { "name" => "some name" },
reference: "some reference",
email_reply_to_id: ENV['EMAIL_REPLY_TO_ID'],
unsubscribe_link: "https://www.clovercouncil.gov.uk/[email protected]"
one_click_unsubscribe_url: "https://www.clovercouncil.gov.uk/[email protected]"
)
test_notification_response_data_type(email_resp, 'email')
email_resp
Expand All @@ -134,7 +134,7 @@ def test_send_email_endpoint_with_document(client)
personalisation: { name: Notifications.prepare_upload(f) },
reference: "some reference",
email_reply_to_id: ENV['EMAIL_REPLY_TO_ID'],
unsubscribe_link: "https://www.clovercouncil.gov.uk/[email protected]")
one_click_unsubscribe_url: "https://www.clovercouncil.gov.uk/[email protected]")
end

test_notification_response_data_type(email_resp, 'email')
Expand Down Expand Up @@ -324,7 +324,7 @@ def expected_fields_in_email_content
%w(from_email
body
subject
unsubscribe_link)
one_click_unsubscribe_url)
end

def expected_fields_in_sms_content
Expand All @@ -348,7 +348,7 @@ def expected_fields_in_email_notification
body
subject
created_at
unsubscribe_link)
one_click_unsubscribe_url)
end

def expected_fields_in_email_notification_that_are_nil
Expand Down Expand Up @@ -388,7 +388,7 @@ def expected_fields_in_sms_notification_that_are_nil
subject
created_by_name
postage
unsubscribe_link)
one_click_unsubscribe_url)
end

def expected_fields_in_letter_notification
Expand Down Expand Up @@ -417,7 +417,7 @@ def expected_fields_in_letter_notification_that_are_nil
line_5
line_6
created_by_name
unsubscribe_link
one_click_unsubscribe_url
)
end

Expand Down Expand Up @@ -449,7 +449,7 @@ def expected_fields_in_precompiled_letter_notification_that_are_nil
phone_number
postcode
sent_at
unsubscribe_link
one_click_unsubscribe_url
)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/notifications/client/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Notification
created_at
completed_at
created_by_name
unsubscribe_link
one_click_unsubscribe_url
).freeze

attr_reader(*FIELDS)
Expand Down
2 changes: 1 addition & 1 deletion lib/notifications/client/speaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def initialize(secret_token = nil, base_url = nil)
# id of the email address that replies to email notifications will be sent to
# @option form_data [String] :sms_sender_id
# id of the sender to be used for an sms notification
# @option form_data [String] :unsubscribe_link
# @option form_data [String] :one_click_unsubscribe_url
# link that end user can click to unsubscribe from the distribution list. We will pass this link in the email headers.
# @see #perform_request!
def post(kind, form_data)
Expand Down

0 comments on commit 8bfc9ce

Please sign in to comment.