add swoosh and oban

This commit is contained in:
2022-02-08 19:59:23 -05:00
parent acf64cee18
commit a39c3da351
26 changed files with 365 additions and 84 deletions

View File

@ -26,7 +26,9 @@ database_url =
"ecto://postgres:postgres@cannery-db/cannery"
end
host = System.get_env("HOST") || "localhost"
host =
System.get_env("HOST") ||
raise "No hostname set! Must be the domain and tld like `cannery.bubbletea.dev`."
interface =
if config_env() in [:dev, :test],
@ -65,6 +67,17 @@ if config_env() == :prod do
config :cannery, CanneryWeb.Endpoint, secret_key_base: secret_key_base
# Set up SMTP settings
config :cannery, Cannery.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: System.get_env("SMTP_HOST") || raise("No SMTP_HOST set!"),
port: System.get_env("SMTP_PORT") || 587,
username: System.get_env("SMTP_USERNAME") || raise("No SMTP_USERNAME set!"),
password: System.get_env("SMTP_PASSWORD") || raise("No SMTP_PASSWORD set!"),
ssl: System.get_env("SMTP_SSL") == "true",
email_from: System.get_env("EMAIL_FROM") || "no-reply@#{System.get_env("HOST")}",
email_name: System.get_env("EMAIL_NAME") || "Cannery"
# ## Using releases
#
# If you are doing OTP releases, you need to instruct Phoenix