-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
165 additions
and
0 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,59 @@ | ||
<?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; | ||
|
||
class OrderShipped extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Get the message envelope. | ||
* | ||
* @return \Illuminate\Mail\Mailables\Envelope | ||
*/ | ||
public function envelope() | ||
{ | ||
return new Envelope( | ||
subject: 'Order Shipped', | ||
); | ||
} | ||
|
||
/** | ||
* Get the message content definition. | ||
* | ||
* @return \Illuminate\Mail\Mailables\Content | ||
*/ | ||
public function content() | ||
{ | ||
return new Content( | ||
markdown: 'emails.orders.shipped', | ||
); | ||
} | ||
|
||
/** | ||
* Get the attachments for the message. | ||
* | ||
* @return array | ||
*/ | ||
public function attachments() | ||
{ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?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; | ||
|
||
class PostPublished extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Get the message envelope. | ||
* | ||
* @return \Illuminate\Mail\Mailables\Envelope | ||
*/ | ||
public function envelope() | ||
{ | ||
return new Envelope( | ||
subject: 'Post Published', | ||
); | ||
} | ||
|
||
/** | ||
* Get the message content definition. | ||
* | ||
* @return \Illuminate\Mail\Mailables\Content | ||
*/ | ||
public function content() | ||
{ | ||
return new Content( | ||
markdown: 'emails.posts.published', | ||
); | ||
} | ||
|
||
/** | ||
* Get the attachments for the message. | ||
* | ||
* @return array | ||
*/ | ||
public function attachments() | ||
{ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<x-mail::message> | ||
# Introduction | ||
|
||
The body of your message. | ||
|
||
<x-mail::button :url="''"> | ||
Button Text | ||
</x-mail::button> | ||
|
||
Thanks,<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,12 @@ | ||
<x-mail::message> | ||
# Introduction | ||
|
||
The body of your message. | ||
|
||
<x-mail::button :url="''"> | ||
Button Text | ||
</x-mail::button> | ||
|
||
Thanks,<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,23 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use App\Mail\OrderShipped; | ||
use App\Mail\PostPublished; | ||
use Illuminate\Contracts\Mail\Mailable; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Illuminate\Foundation\Testing\WithFaker; | ||
use Tests\TestCase; | ||
|
||
class MailTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function mailables_are_available() | ||
{ | ||
$postPublished = new PostPublished(); | ||
$orderShipped = new OrderShipped(); | ||
|
||
$this->assertInstanceOf(Mailable::class, $postPublished); | ||
$this->assertInstanceOf(Mailable::class, $orderShipped); | ||
} | ||
} |