Skip to content

Commit bc70787

Browse files
authored
Merge pull request #2553 from maloun96/execute_with_constraints
Execute now and check constraints
2 parents fb297db + 4f591bc commit bc70787

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Models/MailatorSchedule.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,15 @@ public function shouldSend(): bool
325325
}
326326
}
327327

328+
public function executeWhenPasses(bool $now = false): void
329+
{
330+
$this->save();
331+
332+
if ($this->shouldSend()) {
333+
$this->execute($now);
334+
}
335+
}
336+
328337
public function execute(bool $now = false): void
329338
{
330339
$this->save();

0 commit comments

Comments
 (0)