- Login to SendGrid
- Navigate to settings > API Keys
- Click Create API Key in upper left corner
- Copy to safe location Note: key is only displayed at time of creation.
export SENDGRID_API_KEY=<SENDGRID_API_KEY>
export SENDGRID_DOMAIN=<SENDGRID_DOMAIN>
export DATABASE_URL=ecto://postgres:postgres@localhost/whodapet_dev
export SECRET_KEY_BASE=<SECRET_KEY_BAS>
- In
config/runtime.exs
if config_env() == :prod or config() == :dev do config :whodapet, Whodapet.Mailer, adapter: Swoosh.Adapters.Mailgun, api_key: System.get_env("MAILGUN_API_KEY"), domain: System.get_env("MAILGUN_DOMAIN") config :swoosh, :api_client, Swoosh.ApiClient.Finch end
- In
'lib/application_name/application.ex
include{Finch, name: Swoosh.Finch}
in children