Skip to content

Commit 04ddded

Browse files
committed
only dispatch events for unit tests
1 parent f786fd9 commit 04ddded

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Email.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,10 @@ public function send()
349349

350350
$this->markAsSending();
351351

352-
Event::dispatch('before.send');
353-
352+
if (app()->runningUnitTests()) {
353+
Event::dispatch('before.send');
354+
}
355+
354356
Mail::send([], [], function ($message) {
355357
$message->to($this->getRecipient())
356358
->cc($this->hasCc() ? $this->getCc() : [])
@@ -387,4 +389,4 @@ public function retry()
387389

388390
$retry->save();
389391
}
390-
}
392+
}

0 commit comments

Comments
 (0)