Sendio (sendio v1.1.0)

Official Elixir client for the send.io email API.

See the API reference for every endpoint.

Summary

Functions

Returns a send.io client.

Loads config values from the application environment.

Returns the User-Agent header value sent with every request.

Returns the SDK version (sent in the User-Agent header as sendio-elixir:<version>).

Types

@type config() :: [
  api_key: String.t(),
  base_url: String.t(),
  client: atom(),
  req_options: Keyword.t()
]

Functions

Link to this function

client(config \\ config())

@spec client(config()) :: Sendio.Client.t()

Returns a send.io client.

Accepts a keyword list of config opts, though if omitted then it will attempt to load them from the application environment (falling back to the SENDIO_API_KEY and SENDIO_BASE_URL environment variables).

client = Sendio.client(api_key: "mx_123456789")
client = Sendio.client(api_key: "mx_123456789", base_url: "http://localhost:8080")
@spec config() :: config()

Loads config values from the application environment.

Config options are as follows:

config :sendio, Sendio.Client,
  api_key: "mx_1234567",
  base_url: "https://api.send.io",
  client: Sendio.Client.ReqClient

The only required config option is :api_key. When :api_key is not configured, the SENDIO_API_KEY environment variable is used; when :base_url is not configured, the SENDIO_BASE_URL environment variable is used, then https://api.send.io. A trailing slash on the base URL is optional.

If you would like to replace the HTTP client, configure the :client option. By default, this library uses Req, but changing it is as easy as defining your own client module. See the Sendio.Client module docs for more info.

@spec user_agent() :: String.t()

Returns the User-Agent header value sent with every request.

@spec version() :: String.t()

Returns the SDK version (sent in the User-Agent header as sendio-elixir:<version>).