View Source Paubox.API.Email (paubox v1.0.0)

Documentation for the Paubox.API module.

Summary

Functions

Link to this function

get_receipt(client, source_tracking_id)

View Source

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

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.

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.
Link to this function

send_in_batches(client, msgs, batches_of \\ 50)

View Source

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.