generated from filamentphp/plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customizable notification email mailable (#7)
* Add translations for email * Add custom view for mail * Add translation * Add "Kind regards" translation * Pint * Remove view * Undo * Rename folder to `emails` * Format again (sorry) * Update README * Add TwoFactorCodeMail for sending OTP emails * Format
- Loading branch information
1 parent
3bc2b21
commit 65c4cc3
Showing
6 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<x-mail::message> | ||
{{ __('Hello') }}, | ||
|
||
{{ __('You recently requested to log in to your account. To complete the login, please use the following two-factor authentication (2FA) code:') }} | ||
|
||
<div style="background-color: #f0f0f0; padding: 10px; border-radius: 5px; text-align: center; max-width: 200px; font-family: monospace; margin: 25px auto 25px;"> | ||
<span style="font-size: 1.5em; color: #333;"> | ||
{{ $code }} | ||
</span> | ||
</div> | ||
|
||
|
||
{{ __('If you didn\'t try to log in, please change your password immediately to protect your account.') }} | ||
|
||
{{ __('Kind regards') }},<br> | ||
{{ config('app.name') }} | ||
</x-mail::message> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\TwoFactorAuth\Mail; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Mail\Mailables\Content; | ||
use Illuminate\Mail\Mailables\Envelope; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class TwoFactorCodeMail extends Mailable | ||
{ | ||
use Queueable; | ||
use SerializesModels; | ||
|
||
/** | ||
* Create a new message instance. | ||
*/ | ||
public function __construct(public string $code) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Get the message envelope. | ||
*/ | ||
public function envelope(): Envelope | ||
{ | ||
return new Envelope( | ||
subject: __('Your security code for :app', ['app' => config('app.name')]), | ||
); | ||
} | ||
|
||
/** | ||
* Get the message content definition. | ||
*/ | ||
public function content(): Content | ||
{ | ||
return new Content( | ||
markdown: 'filament-two-factor-auth::emails.two-factor-code', | ||
); | ||
} | ||
|
||
/** | ||
* Get the attachments for the message. | ||
* | ||
* @return array<int, \Illuminate\Mail\Mailables\Attachment> | ||
*/ | ||
public function attachments(): array | ||
{ | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters