diff --git a/config/test.exs b/config/test.exs index f269eff..b325936 100644 --- a/config/test.exs +++ b/config/test.exs @@ -32,3 +32,7 @@ config :recycledcloud, :ldap, base_dn: "dc=example,dc=org", bind_dn: "cn=admin,dc=example,dc=org", bind_pw: "admin" + +# Send emails to local memory for testing. +config :recycledcloud, RecycledCloud.Mailer, + adapter: Bamboo.LocalAdapter diff --git a/lib/recycledcloud/accounts/user_notifier.ex b/lib/recycledcloud/accounts/user_notifier.ex index 84b5655..e058dfa 100644 --- a/lib/recycledcloud/accounts/user_notifier.ex +++ b/lib/recycledcloud/accounts/user_notifier.ex @@ -3,13 +3,13 @@ defmodule RecycledCloud.Accounts.UserNotifier do import Bamboo.Email defp deliver(to, body) do - msg = Mailer.template() + _msg = Mailer.template() |> to(to) |> subject("Recycled Cloud User Management Notification") |> text_body(body) |> Mailer.deliver_now() - {:ok, msg} + {:ok, %{to: to, body: body}} end @doc """