Skip to content

Instantly share code, notes, and snippets.

@lasseebert
Created October 21, 2016 20:19
Show Gist options
  • Save lasseebert/db10bbd433ebfffba71ed41ccf621c21 to your computer and use it in GitHub Desktop.
Save lasseebert/db10bbd433ebfffba71ed41ccf621c21 to your computer and use it in GitHub Desktop.
defmodule MyApp.Mailer do
use Mailgun.Client, [
domain: Application.fetch_env!(:my_app, :mailgun_domain),
key: Application.fetch_env!(:my_app, :mailgun_key)
]
@from "[email protected]"
def send_test_mail(email) do
{:ok, _} = send_email [
to: email,
from: @from,
subject: "Test!",
text: "Test from MyApp"
]
:ok
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment