class GdsApi::AccountApi

def put_email_subscription(name:, topic_slug:, govuk_account_session:)

Returns:
  • (Hash) - Details of the newly created subscription.

Parameters:
  • govuk_account_session (String) -- Value of the session header
  • topic_slug (String) -- The email-alert-api topic slug to subscribe to
  • name (String) -- Name of the subscription
def put_email_subscription(name:, topic_slug:, govuk_account_session:)
  put_json("#{endpoint}/api/email-subscriptions/#{CGI.escape(name)}", { topic_slug: topic_slug }, auth_headers(govuk_account_session))
end