View Source Swoosh.Adapters.Sendinblue (Swoosh v1.6.0)

An adapter that sends email using the Sendinblue API (Transactional emails only).

For reference: Sendinblue API docs


# config/config.exs
config :sample, Sample.Mailer,
  adapter: Swoosh.Adapters.Sendinblue,
  api_key: "my-api-key"

# lib/sample/mailer.ex
defmodule Sample.Mailer do
  use Swoosh.Mailer, otp_app: :sample

Using with provider options

import Swoosh.Email

|> from("")
|> to("")
|> subject("Hello, Wally!")
|> text_body("Hello")
|> put_provider_option(:id, 42)
|> put_provider_option(:template_id, 42)
|> put_provider_option(:params, %{param1: "a", param2: 123})
|> put_provider_option(:tag, %{foo: 1, bar: 2})

Provider Options

  • sender_id (integer) - sender, the sender id where this library will add email obtained from the from/1

  • template_id (integer) - templateId, the Id of the active transactional email template

  • params (map) - params, a map of key/value attributes to customize the template

  • tags (list[string]) - tags, a list of tag for each email for easy filtering

Link to this section Summary

Link to this section Functions

Callback implementation for Swoosh.Adapter.validate_config/1.

Callback implementation for Swoosh.Adapter.validate_dependency/0.