diff --git a/CHANGELOG.md b/CHANGELOG.md index f8790c9..60024f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/bin/test_client.rb b/bin/test_client.rb index 0532bbc..f6ba274 100755 --- a/bin/test_client.rb +++ b/bin/test_client.rb @@ -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/unsubscribe?email_address=faye@example.com" + one_click_unsubscribe_url: "https://www.clovercouncil.gov.uk/unsubscribe?email_address=faye@example.com" ) test_notification_response_data_type(email_resp, 'email') email_resp @@ -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/unsubscribe?email_address=faye@example.com") + one_click_unsubscribe_url: "https://www.clovercouncil.gov.uk/unsubscribe?email_address=faye@example.com") end test_notification_response_data_type(email_resp, 'email') @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/lib/notifications/client/notification.rb b/lib/notifications/client/notification.rb index cb8ed2a..7e0edfe 100644 --- a/lib/notifications/client/notification.rb +++ b/lib/notifications/client/notification.rb @@ -25,7 +25,7 @@ class Notification created_at completed_at created_by_name - unsubscribe_link + one_click_unsubscribe_url ).freeze attr_reader(*FIELDS) diff --git a/lib/notifications/client/speaker.rb b/lib/notifications/client/speaker.rb index af61317..94e6b00 100644 --- a/lib/notifications/client/speaker.rb +++ b/lib/notifications/client/speaker.rb @@ -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)