composer install
Requires MailChimp and Mailgun Api Keys, check MailServiceProvider to configure your mailing services.
This demo covers how we leverage Ioc Container to switch between packages without changing the business logic / actual code implementation (Inversion of Control).
We use MailingListInterface as a common interface for multiple implementations.
Switch implementation, MailServiceProvider and use $this->getMailChimpConcrete()
Change test data, MailListServiceTest and use [$listName, $data] = $this->getMailChimpData(); to switch your test data.
Run your tests. vendor/bin/phpunit --bootstrap=src/app.php
Switch implementation, MailServiceProvider and use $this->getMailGunConcrete()
Change test data, MailListServiceTest and use [$listName, $data] = $this->getMailGunData(); to switch your test data.
Finally, run your tests. vendor/bin/phpunit --bootstrap=src/app.php