Skip to content

matthusby/mailgun

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elixir Mailgun Client

# config/config.exs

config :my_app, mailgun_domain: "foo@bar.com",
                mailgun_key: System.get_env("MAILGUN_KEY")


# lib/mailer.ex
defmodule MyApp.Mailer do
  use Mailgun.Client, domain: Application.get_env(:my_app, :mailgun_domain),
                      key: Application.get_env(:my_app, :mailgun_key)

  @from "info@example.com"

  def send_welcome_email(user) do
    send_email to: user.email,
               from: @from,
               subject: "hello!",
               body: "Welcome!"
  end
end


iex> MyApp.Mailer.send_welcome_email(user)
{:ok, ...}

Installation

Add mailgun to your mix.exs dependencies:

def deps do
  [ {:mailgun, "~> 0.0.1"} ]
end

About

Elixir Mailgun Client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%