jeudi 14 novembre 2019

How to test Laravel Mail sent with string body, not using Mailable

I have this email that goes out

Mail::send([], [], function ($message) use ($email) {
    $message->to($email->to)
        ->subject($email->subject)
        ->setBody($email->content, 'text/html');
});

How can I assert that this mail is sent in a test?

Using the Mail::fake() facade, but Mail::assertSent() wants a string Mailable.

Any advice welcome.

Aucun commentaire:

Enregistrer un commentaire