Skip to content

Commit a106d9b

Browse files
committed
Execute now.
1 parent d3bb760 commit a106d9b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Models/MailatorSchedule.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,18 @@ public function shouldSend(): bool
278278
return $this->configurationsPasses() && $this->whenPasses() && $this->eventsPasses();
279279
}
280280

281-
public function execute(): void
281+
public function execute(bool $now = false): void
282282
{
283283
$this->save();
284284

285285
if ($this->hasCustomAction()) {
286286
app($this->action)->handle($this);
287287
} else {
288-
dispatch(new SendMailJob($this));
288+
if ($now) {
289+
dispatch_sync(new SendMailJob($this));
290+
} else {
291+
dispatch(new SendMailJob($this));
292+
}
289293
}
290294
}
291295

0 commit comments

Comments
 (0)