Integrations

Elixir

Bamboo adapters for Mailtrap Sandbox and Sending APIs.

How it works

Bring Mailtrapโ€™s powerful email capabilities to your Elixir application with the official SDK. Send emails and capture all test messages in a secure sandbox.


Configuration

Step 1: Create a Mailtrap account and verify your domain. 

Step 2: Install Mailtrap by adding the SDK to your mix.exs dependencies, as shown below. โฌ‡๏ธ

def deps do
  [
    {:mailtrap, "~> 1.0"}
  ]
end

Then, run mix deps.get.ย 

Step 3: Send emails – below youโ€™ll find a minimal usage example.

client = Mailtrap.Sending.client("PASTE TOKEN HERE")
email = (%Mailtrap.Email{}
  |> Mailtrap.Email.put_from({"From name", "from@example.com"})
  |> Mailtrap.Email.put_to({"Recepient", "recepient@example.com"})
  |> Mailtrap.Email.put_subject("Hi there")
  |> Mailtrap.Email.put_text("General Kenobi"))
Mailtrap.Sending.send(client, email)

Check the Elixir SDK official documentation for more guidance.


Supported functionalities

  • Email sending.
  • Email sandbox.

Category

SDKs

For developers

Documentation

docs.mailtrap.io