{"action":"closed","issue":{"url":"https://api.github.com/repos/swoosh/swoosh/issues/76","repository_url":"https://api.github.com/repos/swoosh/swoosh","labels_url":"https://api.github.com/repos/swoosh/swoosh/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/swoosh/swoosh/issues/76/comments","events_url":"https://api.github.com/repos/swoosh/swoosh/issues/76/events","html_url":"https://github.com/swoosh/swoosh/issues/76","id":154131088,"number":76,"title":"Mailgun Adapter: ArgumentError :erlang.bit_size(nil)","user":{"login":"monicao","id":165790,"avatar_url":"https://avatars.githubusercontent.com/u/165790?v=3","gravatar_id":"","url":"https://api.github.com/users/monicao","html_url":"https://github.com/monicao","followers_url":"https://api.github.com/users/monicao/followers","following_url":"https://api.github.com/users/monicao/following{/other_user}","gists_url":"https://api.github.com/users/monicao/gists{/gist_id}","starred_url":"https://api.github.com/users/monicao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monicao/subscriptions","organizations_url":"https://api.github.com/users/monicao/orgs","repos_url":"https://api.github.com/users/monicao/repos","events_url":"https://api.github.com/users/monicao/events{/privacy}","received_events_url":"https://api.github.com/users/monicao/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-05-10T23:45:55Z","updated_at":"2016-05-24T21:39:00Z","closed_at":"2016-05-24T21:39:00Z","body":"Using `swoosh: 0.3.0` and `phoenix_swoosh: 0.1.1`.\r\n\r\nI am pretty sure this error is being raised because there is something wrong with my config. It is hard to figure out exactly what is missing from the error message.\r\n\r\n```\r\n> MyApp.Emails.forgot_password(%{first_name: \"Test\", last_name: \"User\", email: \"myemail@gmail.com\"}, \"test\") |> MyApp.Mailer.deliver\r\n** (ArgumentError) argument error\r\n             :erlang.bit_size(nil)\r\n    (swoosh) lib/swoosh/adapters/mailgun.ex:33: Swoosh.Adapters.Mailgun.deliver/2\r\n```\r\n\r\nQuick link to the line in question: https://github.com/swoosh/swoosh/blob/v0.3.0/lib/swoosh/adapters/mailgun.ex#L33\r\n\r\nHere is the adapter configuration.\r\n\r\n```\r\n> Application.get_env(:myapp, MyApp.Mailer)\r\n[adapter: Swoosh.Adapters.Mailgun,\r\n api_key: \"key-a1a2a2s22d2d2d2d2d2d2\",\r\n domain: \"mailgun.myapp.com\"]\r\n```\r\n\r\nAnd the raw `sys.config` entry just in case this is an issue with strings vs binaries.\r\n\r\n```\r\n[\r\n% ... other config stuff here\r\n{myapp, [\r\n  {'Elixir.MyApp.Mailer',[\r\n    {adapter,'Elixir.Swoosh.Adapters.Mailgun'},\r\n    {api_key,<<\"key-a1a2a2s22d2d2d2d2d2d2\">>},\r\n    {domain,<<\"mailgun.myapp.com\">>}]}\r\n]},\r\n]\r\n.\r\n```\r\n\r\nAny ideas why this error is happening? \r\n\r\nThe code works in development where the swoosh config is defined in `config/dev.exs` instead of the `sys.config` file (exrm). \r\n"}}
{"actor":{"display_login":"stevedomin"}}