File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
class TestMail extends Mailable
8
8
{
9
+ protected $ plainText ;
10
+
11
+ public function __construct ($ plainText = false )
12
+ {
13
+ $ this ->plainText = $ plainText ;
14
+ }
15
+
9
16
public function build ()
10
17
{
11
- return $ this ->subject ("Test from HELO " )
12
- ->markdown ('helo::email ' );
18
+ $ this ->subject ("Test from HELO " );
19
+
20
+ return $ this ->plainText ? $ this ->text ('helo::email ' ) : $ this ->markdown ('helo::email ' );
13
21
}
14
22
}
Original file line number Diff line number Diff line change @@ -29,6 +29,16 @@ public function test_the_mail_commands_sends_the_mailable()
29
29
Mail::assertSent (TestMail::class);
30
30
}
31
31
32
+ /** @test */
33
+ public function test_plain_text_mails_work_correctly ()
34
+ {
35
+ Mail::fake ();
36
+
37
+ Mail::
to (
'[email protected] ' )->
send (
new TestMail (
true ));
38
+
39
+ Mail::assertSent (TestMail::class);
40
+ }
41
+
32
42
/** @test */
33
43
public function test_the_correct_mailer_is_binded ()
34
44
{
You can’t perform that action at this time.
0 commit comments