I need to set the MAILER_DSN variable with values that I have to take from the database. How can i do this? How can you override a .env file?
i dont know if Symfony has a Workaround for this, but I would do it that way
- Create a Event Listen for the first Kernel Event.
- In this Event override the $_SERVER[“MAILER_DSN”]
You can try it and give us a Feedback if it works for you.
Or you try to make your own EnvProcessor, that gets die Information from the Database.