diff --git a/lib/bamboo/adapters/mandrill_helper.ex b/lib/bamboo/adapters/mandrill_helper.ex index 1cbcd731..eec0ee26 100644 --- a/lib/bamboo/adapters/mandrill_helper.ex +++ b/lib/bamboo/adapters/mandrill_helper.ex @@ -38,6 +38,11 @@ defmodule Bamboo.MandrillHelper do @doc """ Set merge_vars that are used by Mandrill + ## Example + + email + |> put_merge_vars(users, fn(user) -> %{first_name: user.first_name} end) + A convenience function for: email @@ -61,11 +66,6 @@ defmodule Bamboo.MandrillHelper do ] } ]) - - ## Example - - email - |> put_merge_vars(users, fn(user) -> %{first_name: user.first_name} end) """ def put_merge_vars(email, enumerable, fun) do merge_vars = Enum.map(enumerable, fn(e) -> diff --git a/test/lib/bamboo/adapters/mandrill_helper_test.exs b/test/lib/bamboo/adapters/mandrill_helper_test.exs index 12c4d2a3..8fb510b8 100644 --- a/test/lib/bamboo/adapters/mandrill_helper_test.exs +++ b/test/lib/bamboo/adapters/mandrill_helper_test.exs @@ -21,8 +21,9 @@ defmodule Bamboo.MandrillHelperTest do } ] - email = new_email - |> MandrillHelper.put_merge_vars(users, fn(user) -> %{ full_name: user.full_name } end) + email = MandrillHelper.put_merge_vars new_email, users, fn(user) -> + %{full_name: user.full_name} + end assert email.private.message_params == %{"merge_vars" => [ %{