quazar
How to use different email config for staging and production
How do you guyz maintain different configuration for dev, staging and production. Dev environment is straight forward. I use environment variable with “deferred_config” for most of the production and staging config and that mostly works. But in case of email I would like to use mailtrap config for dev and staging and mailgun for production. Any suggestion? I am using Coherence library.
Most Liked
QuinnWilton
I would probably define a behaviour for the interface you’d like to use for sending email, and then implement that behaviour in a module that wraps Mailtrap, and in a module that wraps Mailgun.
Then in the project config, you can define which module should be used for sending mail, and their respective configurations.
Last Post!
quazar
I am using edeliver create releases so Mix.env is always prod when building a release. I don’t think there is any simple and straight forward way to add runtime config. I hope recent discussion will result in something to solve this problem.
Popular in Questions
Other popular topics
Latest Phoenix Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









