Skip to content

Commit

Permalink
Fix LocalAdapter.deliver/2 return type (#589)
Browse files Browse the repository at this point in the history
Fix the `LocalAdapter.deliver/2` to return a `{:ok, result}` tuple when
the adapter is configured with the `open_email_in_browser_url` option.
  • Loading branch information
SamuelWillis committed Mar 10, 2021
1 parent a94b832 commit 6dae907
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/bamboo/adapters/local_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ defmodule Bamboo.LocalAdapter do
@doc "Adds email to `Bamboo.SentEmail`, can automatically open it in new browser tab"
def deliver(email, %{open_email_in_browser_url: open_email_in_browser_url}) do
%{private: %{local_adapter_id: local_adapter_id}} = SentEmail.push(email)
open_url_in_browser("#{open_email_in_browser_url}/#{local_adapter_id}")

{:ok, open_url_in_browser("#{open_email_in_browser_url}/#{local_adapter_id}")}
end

def deliver(email, _config) do
Expand Down

0 comments on commit 6dae907

Please sign in to comment.