sendgrid v1.0.2 SendGrid.Mailer

Module to send transactional email.

To send emails in sandbox mode, ensure the config key is set:

    config :sendgrid,
      api_key: "SENDGRID_API_KEY",
      sandbox_enable: true

Summary

Functions

Sends the built email

Functions

send(email)

Specs

send(SendGrid.Email.t) ::
  :ok |
  {:error, [String.t]} |
  {:error, String.t}

Sends the built email.

email =
  Email.build()
  |> Email.put_to("test@email.com")
  |> Email.put_from("test2@email.com")
  |> Email.put_subject("Hello from Elixir")
  |> Email.put_text("Sent with Elixir")

:ok = Mailer.send(email)