MillionSend.Suppressions (MillionSend v0.5.0)

Copy Markdown View Source

The suppression list — addresses that are never sent to. Entries come from bounces, complaints and unsubscribes, or are added here. Addressable by id or email.

MillionSend.Suppressions.create(%{email: "gone@acme.dev"})
MillionSend.Suppressions.batch_add(["a@acme.dev", "b@acme.dev"], origin: :manual)
MillionSend.Suppressions.batch_remove(%{emails: ["a@acme.dev"]})

Summary

Functions

POST /suppressions/batch/add — block up to 1000 addresses at once. Options: origin: (default manual). Returns the created entries (id only).

POST /suppressions/batch/remove — unblock by %{emails: [...]} or %{ids: [...]} (up to 1000). Returns the removed entries with deleted: true.

POST /suppressionsemail: plus an optional origin: (default manual).

GET /suppressions/:id_or_email

GET /suppressions — accepts limit:, after:, before: and origin:.

DELETE /suppressions/:id_or_email

Functions

batch_add(emails)

@spec batch_add([String.t()]) ::
  {:ok, [MillionSend.Suppressions.Suppression.t()]}
  | {:error, MillionSend.Error.t()}

POST /suppressions/batch/add — block up to 1000 addresses at once. Options: origin: (default manual). Returns the created entries (id only).

batch_add(client, emails)

@spec batch_add(MillionSend.Client.t() | [String.t()], [String.t()] | keyword()) ::
  {:ok, [MillionSend.Suppressions.Suppression.t()]}
  | {:error, MillionSend.Error.t()}

batch_add(client, emails, opts)

batch_remove(client \\ MillionSend.client(), params)

@spec batch_remove(MillionSend.Client.t(), map()) ::
  {:ok, [MillionSend.Suppressions.Suppression.t()]}
  | {:error, MillionSend.Error.t()}

POST /suppressions/batch/remove — unblock by %{emails: [...]} or %{ids: [...]} (up to 1000). Returns the removed entries with deleted: true.

create(client \\ MillionSend.client(), params)

POST /suppressionsemail: plus an optional origin: (default manual).

get(client \\ MillionSend.client(), id_or_email)

GET /suppressions/:id_or_email

list()

GET /suppressions — accepts limit:, after:, before: and origin:.

list(client)

@spec list(MillionSend.Client.t() | keyword()) ::
  {:ok, MillionSend.List.t()} | {:error, MillionSend.Error.t()}

list(client, opts)

@spec list(
  MillionSend.Client.t(),
  keyword()
) :: {:ok, MillionSend.List.t()} | {:error, MillionSend.Error.t()}

remove(client \\ MillionSend.client(), id_or_email)

DELETE /suppressions/:id_or_email