Skip to content

Instantly share code, notes, and snippets.

@lasseebert
Created October 21, 2016 20:46
Show Gist options
  • Save lasseebert/a01b14dc78a5de344036c9c01d53fd7d to your computer and use it in GitHub Desktop.
Save lasseebert/a01b14dc78a5de344036c9c01d53fd7d to your computer and use it in GitHub Desktop.
defmodule MyApp.Mailer do
@from "[email protected]"
@mailer_impl Application.fetch_env!(:my_app, :mailer)
defmodule Behaviour do
@callback send_mail([key: String.t]) :: :ok
end
def send_test_mail(email) do
:ok = @mailer_impl.send_mail(
to: email,
from: @from,
subject: "Test!",
text: "Test from MyApp"
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment