MLInvoice
MLInvoice copied to clipboard
Mailgun support
in config.php 'send_method' => 'mailgun' 'mailgun' => [ 'key' => 'xxxx', 'domain => 'yyyy.zz' ]
Thanks for this! A couple of suggestions/requests:
- I think it would be more clear if you'd add a new method that handles Mailgun (e.g. sendWithMailgun). Then check the send method in the very beginning of sendEmail() and call sendWithMailgun right away.
- Since you only use the Mailgun class once, there's no real need for the use clause. Just use
new \Mailgun\Mailgun(..)
- I don't know Mailgun requirements, but is the currently used Guzzle not suitable? How about if it's updated so that we don't need two different ones?
- I think it would be clearest to always include Mailgun in composer.json instead of just suggest. Since many use automatic installs from packages, requiring composer to use Mailgun would be too complicated. I can of course make the package creation add Mailgun too if there are downsides to always including it.
- Please make Travis happy!
guzzlehttp/psr7 is PSR-7 Message Implementation not another version. I have no idea why travis is failing
Couple more issues I noticed:
- sendMessage() is deprecated, so it should not be used in new code anymore.
- Indentation has been lost in many places with the ternary operator (?:).
- Add sample settings to config.php.sample.
- Always use short array syntax [] instead of array().
Thanks!
Superseded by #388. With that, you can use Mailgun by using one of the following settings for 'dsn' in config.php:
-
mailgun+smtp://USERNAME:PASSWORD@default
-
mailgun+https://KEY:DOMAIN@default
-
mailgun+api://KEY:DOMAIN@default