Search code examples
laravellumenmandrill

Send emails via Mandrill within Lumen Framework


I already created file in config directory services.php with this code:

<?php
     return [
       'mandrill' => [
            'secret' => env('MANDRILL_SECRET'),
        ],
     ],
];

Also, dependency illuminate/mail (v.^6.3) was added to the project.

But, when I try to send email with this line of code

Mail::to($user->email)->send(new Welcome($user));

I see an error: {"data":null,"errors":{"messages":"Driver [mandrill] not supported.","fields":[]}}

Framework version - Lumen (6.0.2) (Laravel Components ^6.0)


Solution

  • Support for Mandrill mail service was dropped by this commit

    Remove Mandrill and SparkPost mail drivers
    
    We're removing these drivers because we feel that general interest in these is 
    declining and these aren't used by any of Laravel's core services themselves. 
    We're encouraging the community to release packages for these if there's any 
    interest in continued use of them.
    

    So you would have to install a third party package to support it again like intonate/laravel-mandrill-driver

    Also note that it was removed from the docs in 5.3 so you have to read the 5.2 docs for official info or the above package readme

    Hope this helps