sendgrid v2.0.0 SendGrid.Contacts.Lists View Source

Module to interact with modifying email lists.

See SendGrid’s Contact API Docs for more detail.

Link to this section Summary

Functions

Creates an email list

Adds a recipient to an email list

Retrieves all email lists

Retrieves all recipients from an email list

Deletes a recipient from an email list

Link to this section Functions

Link to this function add(list_name, opts \\ []) View Source
add(String.t(), [SendGrid.api_key()]) :: {:ok, map()} | {:error, :any}

Creates an email list.

Options

  • :api_key - API key to use with the request.
Link to this function add_recipient(list_id, recipient_id, opts \\ []) View Source
add_recipient(integer(), String.t(), [SendGrid.api_key()]) ::
  :ok | {:error, any()}

Adds a recipient to an email list.

Options

  • :api_key - API key to use with the request.
Link to this function all(opts \\ []) View Source
all([SendGrid.api_key()]) :: {:ok[map(:ok, map())} | {:error, any()}

Retrieves all email lists.

Options

  • :api_key - API key to use with the request.
Link to this function all_recipients(list_id, opts \\ []) View Source
all_recipients(integer(), [
  SendGrid.api_key() | SendGrid.page() | SendGrid.page_size()
]) :: {:ok[map(:ok, map())} | {:error, any()}

Retrieves all recipients from an email list.

Options

  • :api_key - API key to use with the request.
  • :page - Page to start at. Defaults to 1.
  • :page_size - Page size for pagination. Defaults to 100.
Link to this function delete_recipient(list_id, recipient_id, opts \\ []) View Source
delete_recipient(integer(), String.t(), [SendGrid.api_key()]) ::
  :ok | {:error, any()}

Deletes a recipient from an email list.

Options

  • :api_key - API key to use with the request.