class GdsApi::EmailAlertApi

def bulk_unsubscribe(slug:, govuk_request_id: nil, body: nil, sender_message_id: nil)

Parameters:
  • (optional) (string) -- sender_message_id A UUID to prevent multiple emails for the same event. Required if you want to send an email.
  • (optional) (string) -- body Optional email body to send to alert users they are being unsubscribed. Required if you want to send an email
  • (optional) (string) -- govuk_request_id An ID allowing us to trace requests across our infra. Required if you want to send an email.
  • slug (string) -- Identifier for the subscription list
def bulk_unsubscribe(slug:, govuk_request_id: nil, body: nil, sender_message_id: nil)
  post_json(
    "#{endpoint}/subscriber-lists/#{slug}/bulk-unsubscribe",
    {
      body: body,
      sender_message_id: sender_message_id,
    }.compact,
    {
      "Govuk-Request-Id" => govuk_request_id,
    }.compact,
  )
end