# `Vaartix`
[🔗](https://github.com/vaartix-mail/vaartix-elixir/blob/v0.1.0/lib/vaartix.ex#L1)

The official Elixir client for [Vaartix](https://vaartix.com), the transactional email API built in India.

    client = Vaartix.client()   # reads VAARTIX_API_KEY
    {:ok, %{"id" => id}} =
      Vaartix.Emails.send(client, %{
        from: "Acme <orders@acme.in>",
        to: "priya@example.com",
        subject: "Your order is confirmed",
        html: "<p>Thanks for your order!</p>"
      })

Every function returns `{:ok, result}` or `{:error, %Vaartix.Error{}}`. Results are the API's JSON
as maps with string keys. Keys you pass can be snake_case atoms (`reply_to`, `scheduled_at`) or the
API's camelCase.

# `client`

```elixir
@spec client(String.t() | nil, keyword()) :: Vaartix.Client.t()
```

Create a client. A nil `api_key` reads `VAARTIX_API_KEY`.

Options: `:base_url`, `:receive_timeout` (ms, default 30_000), and `:req_options` passed to Req
(for example `[plug: ...]` or `[adapter: ...]` in tests).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
