Skip to content

Commit 070deb6

Browse files
committed
➕ installation et configuration du package spatie mail preview
1 parent 384ce16 commit 070deb6

File tree

6 files changed

+116
-2
lines changed

6 files changed

+116
-2
lines changed

app/Http/Kernel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class Kernel extends HttpKernel
3838
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
3939
\App\Http\Middleware\VerifyCsrfToken::class,
4040
\Illuminate\Routing\Middleware\SubstituteBindings::class,
41+
42+
\Spatie\MailPreview\Http\Middleware\AddMailPreviewOverlayToResponse::class,
4143
],
4244

4345
'api' => [

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"socialiteproviders/twitter": "^4.1",
3333
"spatie/laravel-feed": "^4.1",
3434
"spatie/laravel-health": "^1.11",
35+
"spatie/laravel-mail-preview": "^6.0",
3536
"spatie/laravel-medialibrary": "^9.0.0",
3637
"spatie/laravel-permission": "^5.1",
3738
"spatie/laravel-sitemap": "^6.1",

composer.lock

Lines changed: 78 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/mail-preview.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
return [
4+
/*
5+
* By default, the overlay will only be shown and mail will only be stored
6+
* when the application is in debug mode.
7+
*/
8+
'enabled' => env('APP_DEBUG', false),
9+
10+
/*
11+
* All mails will be stored in the given directory.
12+
*/
13+
'storage_path' => storage_path('email-previews'),
14+
15+
/*
16+
* This option determines how long generated preview files will be kept.
17+
*/
18+
'maximum_lifetime_in_seconds' => 60,
19+
20+
/*
21+
* When enabled, a link to mail will be added to the response
22+
* every time a mail is sent.
23+
*/
24+
'show_link_to_preview' => true,
25+
26+
/*
27+
* Determines how long the preview pop up should remain visible.
28+
*
29+
* Set this to `false` if the popup should stay visible.
30+
*/
31+
'popup_timeout_in_seconds' => 8,
32+
];

config/mail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
'mailers' => [
3737
'smtp' => [
38-
'transport' => 'smtp',
38+
'transport' => 'preview', // 'smtp',
3939
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
4040
'port' => env('MAIL_PORT', 587),
4141
'encryption' => env('MAIL_ENCRYPTION', 'tls'),

routes/web.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,5 @@
105105
]);
106106

107107
Route::feeds();
108+
109+
Route::mailPreview();

0 commit comments

Comments
 (0)