luisdalmolin / laravel-mandrill-driver

Mandrill mail driver for Laravel for version 6+
MIT License
79 stars 38 forks source link

Extend Swift/Transport for Mandrill #1

Closed nickurt closed 5 years ago

nickurt commented 5 years ago

Extend the SwiftTransport with a new Mandrill/driver, rather than overwriting the TransportManager completely ..

therobfonz commented 5 years ago

This is a good idea. Will pull down to test and merge if it checks out. Thanks for the tweak!

therobfonz commented 5 years ago

Ran a test and this unfortunately doesn't work. 'swift.transport' is not added to the container unless The MailServiceProvider is extended and parent::register() is called.

If you can adjust the service provider and do that, it should work.

nickurt commented 5 years ago

That's odd, I just pulled my branch in a new Laravel 6 application and everything is working as expected

composer.json

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/nickurt/laravel-mandrill-driver"
    }
],

"require": {
    "therobfonz/laravel-mandrill-driver": "dev-patch-1"
},

.env

MAIL_DRIVER=mandrill

config\services.php

'mandrill' => [
    'secret' => 'blablabla',
]

routes\web.php

Route::get('/', function() {
    \Mail::raw('blablabla', function($mail) {
        //
    });
});
therobfonz commented 5 years ago

Interesting. It’s possible I missed something. When I have a solid chunk of time to review it, I’ll double check

nickurt commented 5 years ago

If you manually changed the files, you could have seen an error about the mailer, but a

composer dump-autoload

will fix that ..

therobfonz commented 5 years ago

That was it...thanks. Merged and tagged.