Closed owenstrevor closed 4 years ago
Sorry to hear you're running into issues. It's tough to troubleshoot without seeing your UserNotifier
module, so this feedback will just be general.
The idea is that you should be able replace the body of UserNotifier.deliver/2
with whatever you need to send the email and as long as it still returns {:ok, %{to: to, body: body}}
, everything should continue to work. My hunch is Mail.send/1
is returning :ok
instead of {:ok, %{to: to, body: body}}
. The reason this works for password reset emails is because the UserPasswordResetController.create/2
does not pattern match on the result of Accounts.deliver_user_reset_password_instructions/2
.
Hopefully this suggestion helps you fix the issue you're facing. If you still have issues, it might be helpful to post your UserNotifier
module.
Thank you Aaron for the thoughtful response. This provided me some help with finding the fix. The helpful folks on the Elixir slack also helped.
Just needed to chain this at the end of the deliver function
|> case do
:ok -> {:ok, %{to: to, body: body}}
:error -> IO.inspect
end
Hello, I just setup UserNotifier.ex to work with Sendgrid and now I'm getting this error.
The error is with the 4th line of the above,
{:ok, _} =
User Notifier has been working fine for Password Reset emails.
The IO.inspect returns
:ok