-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from RonasIT/refactoring-mail-classes
refactor: update mails format
- Loading branch information
Showing
13 changed files
with
547 additions
and
546 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace App\Mail; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Mail\Mailables\Content; | ||
use Illuminate\Mail\Mailables\Envelope; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
abstract class BaseMail extends Mailable implements ShouldQueue | ||
{ | ||
use Queueable; | ||
use SerializesModels; | ||
|
||
public int $tries = 5; | ||
|
||
public function __construct(public $viewData) | ||
{ | ||
$this->queue = 'mails'; | ||
} | ||
|
||
abstract public function envelope(): Envelope; | ||
|
||
abstract public function content(): Content; | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace App\Mail; | ||
|
||
use Illuminate\Mail\Mailables\Content; | ||
use Illuminate\Mail\Mailables\Envelope; | ||
|
||
class ForgotPasswordMail extends BaseMail | ||
{ | ||
public function envelope(): Envelope | ||
{ | ||
return new Envelope( | ||
subject: __('Forgot password?'), | ||
); | ||
} | ||
|
||
public function content(): Content | ||
{ | ||
return new Content( | ||
view: 'emails.forgot_password', | ||
with: $this->viewData, | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.