Bogardo / Mailgun

Mailgun package for Laravel
MIT License
295 stars 115 forks source link

Unable to parse URI: https://///messages #115

Closed iulianba closed 6 years ago

iulianba commented 7 years ago

Hello,

I think I did something wrong when I tried to implement Guzzle 6 example. Before this step, I was always getting class mailgun.client does not exist

So I added in register of AppServiceProvider:

$this->app->bind('mailgun.client', function() {
    return \Http\Adapter\Guzzle6\Client::createWithConfig([

    ]);
});

Do i need to actually write a config in there? I have no idea what should I do.

Thanks

darkostanimirovic commented 7 years ago

I'm having the same issue. Upgraded to v5, got class mailgun.client does not exist, installed Guzzle6 adapter, bound to container (with no config) and now I'm seeing this error message. I assume I need to add a base url or something, but it would be useful if there was an upgrade guide when new versions have breaking changes.

iulianba commented 7 years ago

I fixed the issue by generating the config file. In older versions this was not a requirement, from what I knew:

php artisan vendor:publish --provider="Bogardo\Mailgun\MailgunServiceProvider" --tag="config"

Configure api settings and you should be good to go.

darkostanimirovic commented 7 years ago

Thanks! One question – setting has a public_api_key. Not sure what that is, Mailgun only gives private key, domain, smtp user/pass.

iulianba commented 7 years ago

I added the private key to both public_api_key and api_key. Not sure if it`s the smart/right way of doing it.

Bogardo commented 7 years ago

You can find your public API key in your account under 'Security'. https://app.mailgun.com/app/account/security

The key should start with pubkey-

iulianba commented 7 years ago

I have the same key under the link you provided and domain settings. And starts with: key-xxxx

Is it safe to add it for public_api_key and api_key?

Thanks

dimasx010 commented 5 years ago

in laravel v 5.7 need install

composer require php-http/guzzle6-adapter ^1.0

add in providers

$this->app->bind('mailgun.client', function() {
    return \Http\Adapter\Guzzle6\Client::createWithConfig([

    ]);
});

And finally

php artisan vendor:publish --provider="Bogardo\Mailgun\MailgunServiceProvider" --tag="config"

Gracias Totales