View Source Paubox Elixir API Client

This is a simple Elixir client for the Paubox Email API. More about the API can be found at Paubox.

Installation

If available in Hex, the package can be installed by adding paubox to your list of dependencies in mix.exs:

def deps do
  [
    {:paubox, "~> 1.0.0"}
  ]
end

Usage

You can either pass in an API key and API user to the client or set them as environment variables, PAUBOX_API_KEY and PAUBOX_API_USER.

This is the message used in the examples below.

message =  %Paubox.Message{
  subject:  "Hey y'all!",
  from: "messenger@example.local",
  recipients: ["someone@somewhere.local"]
}

Sending a Single Message

Paubox.API.Email.client(%{api_key: "your_api_key", api_user: "your_api_user"})
|> Paubox.API.Email.send_email(message)

# or if the environment variables are set
Paubox.API.Email.client() |> Paubox.API.Email.send_email(message)

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/paubox.