File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -36,18 +36,18 @@ It has mainly 2 directions of usage:
36
36
37
37
To set up a mail to be sent after or before an event, you can do this by using the ` Scheduler ` facade.
38
38
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 ` :
40
40
41
41
``` php
42
42
use Binarcode\LaravelMailator\Tests\Fixtures\InvoiceReminderMailable;
43
43
use Binarcode\LaravelMailator\Tests\Fixtures\SerializedConditionCondition;
44
44
45
45
Binarcode\LaravelMailator\Scheduler::init('Invoice reminder.')
46
- ->mailable(new InvoiceReminderMailable())
46
+ ->mailable(new InvoiceReminderMailable($invoice ))
47
47
->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 )
51
51
->save();
52
52
```
53
53
You can’t perform that action at this time.
0 commit comments