feat(users): wire up forgot password to swoosh

closes #4

Signed-off-by: SphericalKat <amolele@gmail.com>
This commit is contained in:
sphericalkat committed 2021-08-20 02:09:14 +05:30
1 parent 816332bdd6
commit 36ad9d1000
7 files changed
+80 -1

No files matched your search

+9
View File
@@ -1,4 +1,5 @@
defmodule Ketbin.Accounts.UserNotifier do
import Swoosh.Email
# For simplicity, this module simply logs messages to the terminal.
# You should replace it by a proper email or notification tool, such as:
#
@@ -8,6 +9,14 @@ defmodule Ketbin.Accounts.UserNotifier do
defp deliver(to, body) do
require Logger
Logger.debug(body)
new()
|> to(to)
|> from("noreply@katb.in")
|> subject("Password reset requested")
|> text_body(body)
|> Ketbin.Mailer.deliver()
{:ok, %{to: to, body: body}}
end
+3
View File
@@ -0,0 +1,3 @@
defmodule Ketbin.Mailer do
use Swoosh.Mailer, otp_app: :ketbin
end