Skip to content

Commit

Permalink
Log the config and the email being sent
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Smith committed Dec 14, 2015
1 parent bd517bc commit b2cc7c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use Mix.Config
#
# Or configure a 3rd-party app:
#
# config :logger, level: :info
config :logger, level: :warn
#

# It is also possible to import configuration files, relative to this
Expand Down
14 changes: 14 additions & 0 deletions lib/bamboo/adapters/mandrill_adapter.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
defmodule Bamboo.MandrillAdapter do
require Logger

@default_base_uri "https://mandrillapp.com/"
@send_message_path "api/1.0/messages/send.json"

Expand All @@ -23,6 +25,18 @@ defmodule Bamboo.MandrillAdapter do
end

def deliver(email, config) do
Logger.debug """
Sending email with Bamboo
* Config
#{inspect config}
* Email
#{inspect email}
"""

api_key = Keyword.fetch!(config, :api_key)
params = email |> convert_to_mandrill_params(api_key) |> Poison.encode!
case request!(@send_message_path, params) do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Bamboo.Mixfile do

def project do
[app: :bamboo,
version: "0.1.0",
version: "0.1.1",
elixir: "~> 1.1",
compilers: compilers(Mix.env),
elixirc_paths: elixirc_paths(Mix.env),
Expand Down

0 comments on commit b2cc7c6

Please sign in to comment.