Deploying Swoosh Mailer to prod

Hello all!

I’m trying to deploy Swoosh/Mailgun to production. Everything is the latest Phoenix-generated code. My config is

config :bouncer, Bouncer.Mailer,
  adapter: Swoosh.Adapters.Mailgun,
  api_key: "${MAILGUN_API_KEY}",
  domain: "mailgun.domain.com"

I can shell into prod and confirm this is correct.

My issue is that my application fails to boot in production unless I comment out the generated Bouncer.Mailer module:

defmodule Bouncer.Mailer do
  use Swoosh.Mailer, otp_app: :bouncer
end

The actual error:

Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,'Elixir.Bouncer.Mailer',abort}}},{kernel,start,[normal,[]]}}})

along with other erlang output that says nothing but points to Bouncer.Mailer. I have gen_smtp and hackeny installed as well.

All freshly generated code and it works in development. Thoughts?

Do you have the following somewhere?

config :swoosh, :api_client, false

If so, you’ll need to change that see the installation docs.

Oh wait… is it trying to start your Mailer? Is it listed in children of your Bouncer.Application?