Skip to content

Instantly share code, notes, and snippets.

@ohnotnow
Created December 8, 2017 09:17
Show Gist options
  • Save ohnotnow/ac8ccc03bdea692fc2a2854d0849a459 to your computer and use it in GitHub Desktop.
Save ohnotnow/ac8ccc03bdea692fc2a2854d0849a459 to your computer and use it in GitHub Desktop.
Rendering the contents of a laravel mail notification in a test
Notification::assertSentTo($user, MyNotification::class, function ($notification) use ($user) {
$markdown = app(\Illuminate\Mail\Markdown::class);
$mail = $notification->toMail($user);
dd($markdown->render($mail->markdown, $mail->data()));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment