Skip to content

Commit c0a9b9b

Browse files
committed
Allow custom email view name
1 parent d84636c commit c0a9b9b

File tree

2 files changed

+33
-12
lines changed

2 files changed

+33
-12
lines changed

src/Mail/VerificationTokenGenerated.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,13 @@ public function build()
7474
: $this->subject);
7575

7676
if (config('user-verification.email.type') == 'markdown') {
77-
$this->markdown('laravel-user-verification::email-markdown');
77+
is_null($view = config('user-verification.email.view'))
78+
? $this->markdown('laravel-user-verification::email-markdown')
79+
: $this->markdown($view);
7880
} else {
79-
$this->view('laravel-user-verification::email');
81+
is_null($view = config('user-verification.email.view'))
82+
? $this->view('laravel-user-verification::email')
83+
: $this->view($view);
8084
}
8185

8286
return $this;

src/config/user-verification.php

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,43 @@
33
return [
44

55
/*
6-
|--------------------------------------------------------------------------
7-
| Default Email View Type
8-
|--------------------------------------------------------------------------
9-
|
10-
| This option controls the default email view type.
11-
|
12-
| Supported: "default", "markdown"
6+
|---------------------------------------------------------------------------
7+
| E-mail options
8+
|---------------------------------------------------------------------------
139
|
1410
*/
1511
'email' => [
12+
/*
13+
|-----------------------------------------------------------------------
14+
| Email View Type
15+
|-----------------------------------------------------------------------
16+
|
17+
| This option defines the email view type.
18+
|
19+
| Supported: "default", "markdown"
20+
|
21+
*/
1622
'type' => 'default',
23+
24+
/*
25+
|-----------------------------------------------------------------------
26+
| Custom view name
27+
|-----------------------------------------------------------------------
28+
|
29+
| This option defines a custom view name.
30+
|
31+
*/
32+
'view' => null,
1733
],
1834

1935
/*
20-
|--------------------------------------------------------------------------
36+
|---------------------------------------------------------------------------
2137
| Log the user in after verification
22-
|--------------------------------------------------------------------------
38+
|---------------------------------------------------------------------------
2339
|
24-
| This option defines if the user should be loged in after verification.
40+
| This option defines if the user should be logged in after verification.
2541
| USE WITH CAUTION as it may introduce security issues in your app.
42+
| By default Laravel log in a new registered user.
2643
|
2744
| Supported: (bool) "true", "false"
2845
|

0 commit comments

Comments
 (0)