diff --git a/config/config.exs b/config/config.exs deleted file mode 100644 index 04bb4627..00000000 --- a/config/config.exs +++ /dev/null @@ -1,30 +0,0 @@ -# This file is responsible for configuring your application -# and its dependencies with the aid of the Mix.Config module. -use Mix.Config - -# This configuration is loaded before any dependency and is restricted -# to this project. If another project depends on this project, this -# file won't be loaded nor affect the parent project. For this reason, -# if you want to provide default values for your application for -# 3rd-party users, it should be done in your "mix.exs" file. - -# You can configure for your application as: -# -# config :bamboo, key: :value -# -# And access this configuration in your application as: -# -# Application.get_env(:bamboo, :key) -# -# Or configure a 3rd-party app: -# -config :logger, level: :warn -# - -# It is also possible to import configuration files, relative to this -# directory. For example, you can emulate configuration per environment -# by uncommenting the line below and defining dev.exs, test.exs and such. -# Configuration from the imported file will override the ones defined -# here (which is why it is important to import them last). -# -# import_config "#{Mix.env}.exs" diff --git a/lib/bamboo/adapters/mailgun_adapter.ex b/lib/bamboo/adapters/mailgun_adapter.ex index b346065f..4115d21f 100644 --- a/lib/bamboo/adapters/mailgun_adapter.ex +++ b/lib/bamboo/adapters/mailgun_adapter.ex @@ -249,8 +249,7 @@ defmodule Bamboo.MailgunAdapter do end defp prepare_file(%Attachment{} = attachment) do - {"", attachment.data, - {"form-data", [{"name", ~s/"attachment"/}, {"filename", ~s/"#{attachment.filename}"/}]}, []} + {"", attachment.data, {"form-data", [{"name", ~s/"attachment"/}, {"filename", ~s/"#{attachment.filename}"/}]}, []} end @mailgun_message_fields ~w(from to cc bcc subject text html template recipient-variables)a diff --git a/lib/bamboo/adapters/send_grid_adapter.ex b/lib/bamboo/adapters/send_grid_adapter.ex index 21dac2ef..8121d185 100644 --- a/lib/bamboo/adapters/send_grid_adapter.ex +++ b/lib/bamboo/adapters/send_grid_adapter.ex @@ -428,8 +428,7 @@ defmodule Bamboo.SendGridAdapter do end defp cast_address_as_map(address) do - case {Map.get(address, :name, Map.get(address, "name")), - Map.get(address, :email, Map.get(address, "email"))} do + case {Map.get(address, :name, Map.get(address, "name")), Map.get(address, :email, Map.get(address, "email"))} do {_name, nil} -> throw({:error, "Must specify at least an 'email' field in map #{inspect(address)}"}) diff --git a/lib/bamboo/view.ex b/lib/bamboo/view.ex index fb3c7a98..e61d4a0e 100644 --- a/lib/bamboo/view.ex +++ b/lib/bamboo/view.ex @@ -109,9 +109,7 @@ defmodule Bamboo.View do true -> raise ArgumentError, """ - Template name must end in either ".html" or ".text". Template name was #{ - inspect(template) - } + Template name must end in either ".html" or ".text". Template name was #{inspect(template)} If you would like to render both and html and text template, use an atom without an extension instead. diff --git a/test/lib/bamboo/adapters/mailgun_helper_test.exs b/test/lib/bamboo/adapters/mailgun_helper_test.exs index c89aee18..382f4df8 100644 --- a/test/lib/bamboo/adapters/mailgun_helper_test.exs +++ b/test/lib/bamboo/adapters/mailgun_helper_test.exs @@ -69,8 +69,7 @@ defmodule Bamboo.MailgunHelperTest do }) assert email.private == %{ - mailgun_recipient_variables: - "{\"user1@example.com\":{\"unique_id\":\"ABC123456789\"}}" + mailgun_recipient_variables: "{\"user1@example.com\":{\"unique_id\":\"ABC123456789\"}}" } end end diff --git a/test/lib/bamboo/adapters/mandrill_adapter_test.exs b/test/lib/bamboo/adapters/mandrill_adapter_test.exs index 7f0306fb..98bff1ec 100644 --- a/test/lib/bamboo/adapters/mandrill_adapter_test.exs +++ b/test/lib/bamboo/adapters/mandrill_adapter_test.exs @@ -115,18 +115,15 @@ defmodule Bamboo.MandrillAdapterTest do ) |> Email.put_header("Reply-To", "reply@foo.com") |> Email.put_attachment(file_path) - |> Email.put_attachment( - Attachment.new(file_path, content_id: "my_fake_image", filename: "fake_image.jpg") - ) + |> Email.put_attachment(Attachment.new(file_path, content_id: "my_fake_image", filename: "fake_image.jpg")) |> Email.put_attachment(%Attachment{ content_type: "image/png", content_id: "my_image", filename: "my_image.png", data: - <<137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 1, 0, 0, 0, 1, - 8, 6, 0, 0, 0, 31, 21, 196, 137, 0, 0, 0, 13, 73, 68, 65, 84, 120, 218, 99, 252, 207, - 192, 80, 15, 0, 4, 133, 1, 128, 132, 169, 140, 33, 0, 0, 0, 0, 73, 69, 78, 68, 174, - 66, 96, 130>> + <<137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 1, 0, 0, 0, 1, 8, 6, 0, 0, 0, 31, 21, + 196, 137, 0, 0, 0, 13, 73, 68, 65, 84, 120, 218, 99, 252, 207, 192, 80, 15, 0, 4, 133, 1, 128, 132, 169, + 140, 33, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130>> }) email |> MandrillAdapter.deliver(@config) @@ -214,7 +211,7 @@ defmodule Bamboo.MandrillAdapterTest do email = new_email() |> MandrillHelper.template("hello", [ - %{name: 'example name', content: 'example content'} + %{name: ~c"example name", content: ~c"example content"} ]) email |> MandrillAdapter.deliver(@config) @@ -228,7 +225,7 @@ defmodule Bamboo.MandrillAdapterTest do }} assert template_name == "hello" - assert template_content == [%{"content" => 'example content', "name" => 'example name'}] + assert template_content == [%{"content" => ~c"example content", "name" => ~c"example name"}] end test "returns an error if the response is not a success" do diff --git a/test/lib/bamboo/mailer_test.exs b/test/lib/bamboo/mailer_test.exs index 2ebdf954..114b2a6f 100644 --- a/test/lib/bamboo/mailer_test.exs +++ b/test/lib/bamboo/mailer_test.exs @@ -457,8 +457,7 @@ defmodule Bamboo.MailerTest do email = new_email(to: "foo@bar.com") assert {:ok, %Bamboo.Email{blocked: false}} = Mailer.deliver_now(email) - assert_receive {:deliver, %Bamboo.Email{to: [{nil, "foo@bar.com"}], subject: "test - "}, - _config} + assert_receive {:deliver, %Bamboo.Email{to: [{nil, "foo@bar.com"}], subject: "test - "}, _config} end @tag interceptors: [Bamboo.DenyListInterceptor, Bamboo.EnvInterceptor] @@ -473,8 +472,7 @@ defmodule Bamboo.MailerTest do email = new_email(to: "foo@bar.com") assert %Bamboo.Email{blocked: false} = Mailer.deliver_now!(email) - assert_receive {:deliver, %Bamboo.Email{to: [{nil, "foo@bar.com"}], subject: "test - "}, - _config} + assert_receive {:deliver, %Bamboo.Email{to: [{nil, "foo@bar.com"}], subject: "test - "}, _config} end @tag interceptors: [Bamboo.DenyListInterceptor, Bamboo.EnvInterceptor] @@ -491,8 +489,7 @@ defmodule Bamboo.MailerTest do email = new_email(to: "foo@bar.com") assert {:ok, %Bamboo.Email{blocked: false}} = Mailer.deliver_later(email) - assert_receive {:deliver, %Bamboo.Email{to: [{nil, "foo@bar.com"}], subject: "test - "}, - _config} + assert_receive {:deliver, %Bamboo.Email{to: [{nil, "foo@bar.com"}], subject: "test - "}, _config} end @tag interceptors: [Bamboo.DenyListInterceptor, Bamboo.EnvInterceptor] @@ -509,8 +506,7 @@ defmodule Bamboo.MailerTest do email = new_email(to: "foo@bar.com") assert %Bamboo.Email{blocked: false} = Mailer.deliver_later!(email) - assert_receive {:deliver, %Bamboo.Email{to: [{nil, "foo@bar.com"}], subject: "test - "}, - _config} + assert_receive {:deliver, %Bamboo.Email{to: [{nil, "foo@bar.com"}], subject: "test - "}, _config} end @tag interceptors: [Bamboo.DenyListInterceptor, Bamboo.EnvInterceptor]