Mailgun
Mailgun copied to clipboard
Using full api from mailgun-php
Had some issues with using the full api implementation in mailgun-php, but got it working by setting up Guzzle correctly. This allows you to use the full API on this page through Mailgun::api()
https://github.com/mailgun/mailgun-php/blob/master/doc/index.md
The updated code for the service provider
$this->app->bind('mailgun.client', function() {
$headers['Authorization'] = 'Basic '.base64_encode(sprintf('%s:%s', 'api', config('mailgun.api_key')));
return \Http\Adapter\Guzzle6\Client::createWithConfig([
'base_uri' => 'https://' . config('mailgun.api.endpoint'),
'headers' => $headers
]);
});
Hope this helps someone
@Resin01 what do you think of this approach instead? This worked for me. https://github.com/Bogardo/Mailgun/issues/156
I am unsure what the improvement is ? Without guzzle being setup as specified, the API work work (at least it doesnt for me)