From eb33bf77cc7ee17bfb21449c7bba51a9a64e43e9 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Sun, 13 Sep 2026 11:02:03 +0200 Subject: [PATCH] Send Markdown mail in the Material theme Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01V9NnLxnPp8vaaurb3Z1MFy --- config/mail.php | 22 ++++++++++++++++++++++ tests/Feature/Auth/PasswordResetTest.php | 11 +++++++++++ 2 files changed, 33 insertions(+) diff --git a/config/mail.php b/config/mail.php index 522b284..9585c48 100644 --- a/config/mail.php +++ b/config/mail.php @@ -115,4 +115,26 @@ return [ 'name' => env('MAIL_FROM_NAME', 'Example'), ], + /* + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | Markdown mail wears Livewire Material's theme, coloured from the light + | scheme in resources/css/material-scheme.json. + | + */ + + 'markdown' => [ + 'theme' => env('MAIL_MARKDOWN_THEME', 'livewire-material::mail.theme'), + + 'paths' => [ + resource_path('views/vendor/mail'), + ], + + 'extensions' => [ + // \League\CommonMark\Extension\Strikethrough\StrikethroughExtension::class, + ], + ], + ]; diff --git a/tests/Feature/Auth/PasswordResetTest.php b/tests/Feature/Auth/PasswordResetTest.php index 47782b8..bc8a005 100644 --- a/tests/Feature/Auth/PasswordResetTest.php +++ b/tests/Feature/Auth/PasswordResetTest.php @@ -58,3 +58,14 @@ test('password can be reset with valid token', function () { return true; }); }); + +test('reset password mail wears the material theme in the app scheme', function () { + $user = User::factory()->create(); + $scheme = json_decode(file_get_contents(resource_path('css/material-scheme.json')), true); + + $html = (string) (new ResetPassword('token'))->toMail($user)->render(); + + expect($html) + ->toContain('background-color: '.$scheme['light']['primary']) + ->toContain(route('password.reset', ['token' => 'token', 'email' => $user->email])); +});