Quickstarts
Send with Elixir
Send email from Elixir with the usend SDK, plain HTTP or SMTP.
The usend Elixir SDK has no dependencies (it uses OTP's :httpc). You need a verified domain and an API key.
1. Dependency
defp deps do
[{:usend, "~> 1.0"}]
endmix deps.get2. Send an email
client = Usend.new(System.fetch_env!("USEND_API_KEY"))
case Usend.send_email(client, %{
from: "Acme <[email protected]>",
to: ["[email protected]"],
subject: "Hello from usend",
html: "<p>It works!</p>"
}) do
{:ok, %{"id" => id}} -> IO.puts("queued #{id}")
{:error, %Usend.Error{name: name, message: message}} -> IO.puts("failed: #{name}: #{message}")
endPass idempotency_key: Usend.new_idempotency_key() as the third argument to make retries safe. Rate-limited requests are retried for you.
Verify a webhook
{:ok, event} = Usend.Webhook.verify(raw_body, conn.req_headers, System.fetch_env!("USEND_WEBHOOK_SECRET"), 300)Plain HTTP and SMTP
You can skip the SDK: POST https://api.usend.et/emails with Authorization: Bearer <key> works from Req or any HTTP client.
Swoosh can send over SMTP (smtp.usend.et, port 587 or 465, username usend, your API key as the password; Usend.smtp_config(client) returns these settings). See Send with SMTP.