From 6dae907714d726de60b1fb874eba1652078ccf2b Mon Sep 17 00:00:00 2001 From: Samuel Willis Date: Wed, 10 Mar 2021 06:04:29 -0800 Subject: [PATCH] Fix LocalAdapter.deliver/2 return type (#589) Fix the `LocalAdapter.deliver/2` to return a `{:ok, result}` tuple when the adapter is configured with the `open_email_in_browser_url` option. --- lib/bamboo/adapters/local_adapter.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bamboo/adapters/local_adapter.ex b/lib/bamboo/adapters/local_adapter.ex index de06e9bc..e2358f0a 100644 --- a/lib/bamboo/adapters/local_adapter.ex +++ b/lib/bamboo/adapters/local_adapter.ex @@ -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