Skip to content

Commit 9c8de7f

Browse files
authored
Update README.md
1 parent b674c73 commit 9c8de7f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ It has mainly 2 directions of usage:
3636

3737
To set up a mail to be sent after or before an event, you can do this by using the `Scheduler` facade.
3838

39-
Firstly lets set up a mail scheduler:
39+
Here is an example of how to send the `invoice reminder email` `3 days` before the `$invoice->due_date`:
4040

4141
```php
4242
use Binarcode\LaravelMailator\Tests\Fixtures\InvoiceReminderMailable;
4343
use Binarcode\LaravelMailator\Tests\Fixtures\SerializedConditionCondition;
4444

4545
Binarcode\LaravelMailator\Scheduler::init('Invoice reminder.')
46-
->mailable(new InvoiceReminderMailable())
46+
->mailable(new InvoiceReminderMailable($invoice))
4747
->recipients('foo@binarcode.com', 'baz@binarcode.com')
48-
->constraint(new SerializedConditionCondition(User::first()))
49-
->days(1)
50-
->before(now()->addYear())
48+
->constraint(new SerializedConditionCondition($invoice))
49+
->days(3)
50+
->before($invoice->due_date)
5151
->save();
5252
```
5353

0 commit comments

Comments
 (0)