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])); +});