Paubox.API.Email (paubox v1.1.0)

Copy Markdown View Source

Documentation for the Paubox.API module.

Summary

Functions

client()

client(opts)

client(map, opts)

get_receipt(client, source_tracking_id)

Get the receipt for a message with the given source tracking ID. See: https://docs.paubox.com/docs/paubox_email_api/messages#get-email-disposition

send(client, msg)

See: https://docs.paubox.com/docs/paubox_email_api/messages#send-message

Send a single Paubox.Message to the Paubox API.

Possible responses are:

  • {:ok, %Paubox.API.SendResponse{}}: The message was successfully sent.
  • {:api_error, %{errors: []}}: The API returned an error.
  • {:error, String.t()}: An error occurred while sending the message.

send_bulk(client, msgs)

See: https://docs.paubox.com/docs/paubox_email_api/messages#send-bulk-messages

Send multiple Paubox.Message structs to the Paubox API in a single request. The Paubox documentation recommends sending batches of 50 or less. Source tracking IDs are generated for each message and are returned in the order they are in the request.

Possible responses are:

  • {:ok, [%Paubox.API.SendResponse{} | _rest]}: The messages were successfully sent.

  • {:api_error, %{errors: []}}: The API returned an error.
  • {:error, String.t()}: An error occurred while sending the messages.

send_in_batches(client, msgs, batches_of \\ 50)

This is a thin wrapper around send_bulk/2 that sends messages in batches of a passed in value or using the default of 50. The response is the same as send_bulk/2.