I'm working on a CodeIgniter 3.1.4 project and am aware that I can use MY_
prefixed library classes to extend the system libraries.
This is great and works as expected, but I'd like to be able to determine the class being used dependant on either the current environment, or by DotEnv values (I've already got a DotEnv library working fine).
The production site uses the servers 'sendmail' to send email, I would like to be able to use MailGun (or another) in development, allowing me to overriding the 'to'
value just before sending to allow for safe development utilising a production like dataset.
Much like is able to be done in Laravel where you can use .env
's MAIL_DRIVER=mailgun
and MAIL_TO_ADDRESS=x@y.com
to force all outbound mail to one address for development.
I'm sure it must be possible, but my lack of experience with CI and where I should be implementing this into the framework is letting me down.