File tree 1 file changed +5
-1
lines changed
src/Codeception/Lib/Connector
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,11 @@ public function startApp(?\yii\log\Logger $logger = null): void
308
308
309
309
match ($ this ->mailMethod ) {
310
310
self ::MAIL_CATCH => $ config = $ this ->mockMailer ($ config ),
311
- self ::MAIL_EVENT_AFTER => $ config ['components ' ]['mailer ' ]['on ' . BaseMailer::EVENT_AFTER_SEND ] = fn (MailEvent $ event ) => $ this ->emails [] = $ event ->message ,
311
+ self ::MAIL_EVENT_AFTER => $ config ['components ' ]['mailer ' ]['on ' . BaseMailer::EVENT_AFTER_SEND ] = function (MailEvent $ event ): void {
312
+ if ($ event ->isSuccessful ) {
313
+ $ this ->emails [] = $ event ->message ;
314
+ }
315
+ },
312
316
self ::MAIL_EVENT_BEFORE => $ config ['components ' ]['mailer ' ]['on ' . BaseMailer::EVENT_BEFORE_SEND ] = fn (MailEvent $ event ) => $ this ->emails [] = $ event ->message ,
313
317
self ::MAIL_IGNORE => null // Do nothing
314
318
};
You can’t perform that action at this time.
0 commit comments