File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -152,13 +152,15 @@ public function send(): Email
152
152
(new MailableReader ())->read ($ this );
153
153
}
154
154
155
- if (! $ this ->email ->from ) {
156
- $ this ->email ->from = [
157
- 'address ' => config ('mail.from.address ' ),
158
- 'name ' => config ('mail.from.name ' ),
159
- ];
155
+ if (! is_array ($ this ->email ->from )) {
156
+ $ this ->email ->from = [];
160
157
}
161
158
159
+ $ this ->email ->from = [
160
+ 'name ' => $ this ->email ->from ['name ' ] ?? config ('mail.from.name ' ),
161
+ 'address ' => $ this ->email ->from ['address ' ] ?? config ('mail.from.address ' ),
162
+ ];
163
+
162
164
$ this ->email ->save ();
163
165
164
166
$ this ->email ->refresh ();
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public function it_extracts_the_from_address_and_or_name()
106
106
107
107
$ this ->assertTrue ((bool ) $ email ->from );
108
108
$ this ->assertEquals ('marick@dolphiq.nl ' , $ email ->from ['address ' ]);
109
- $ this ->assertEquals (null , $ email ->from ['name ' ]);
109
+ $ this ->assertEquals (' Example ' , $ email ->from ['name ' ]);
110
110
111
111
$ email = Email::compose ()->mailable (
112
112
($ this ->mailable ())
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public function the_email_has_a_correct_from_email_and_from_name()
68
68
$ this ->artisan ('email:send ' );
69
69
$ from = reset ($ this ->sent )->from ;
70
70
$ this ->assertEquals ('marick@dolphiq.nl ' , key ($ from ));
71
- $ this ->assertEquals (null , $ from [key ($ from )]);
71
+ $ this ->assertEquals (' From CI test ' , $ from [key ($ from )]);
72
72
}
73
73
74
74
#[Test]
You can’t perform that action at this time.
0 commit comments