d

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.

15 St Margarets, NY 10033
(+381) 11 123 4567
ouroffice@aware.com

 

KMF

Email Scheduler Package for Laravel

The Mailator package is an email scheduler for Laravel. It provides a lightweight package around configuring email schedules and templates based on application events:

1use BinarcodeLaravelMailatorTestsFixturesInvoiceReminderMailable;

2use BinarcodeLaravelMailatorTestsFixturesSerializedConditionCondition;

3 

4BinarcodeLaravelMailatorScheduler::init('Invoice reminder.')

5 ->mailable(new InvoiceReminderMailable($invoice))

6 ->recipients('foo@binarcode.com', 'baz@binarcode.com')

7 ->constraint(new SerializedConditionCondition($invoice))

8 ->days(3)

9 ->before($invoice->due_date)

10 ->save();

The above example takes a Mailable instance, recipients, a set of sending constraints that must evaluate to true, and the ability to schedule the email send “three days before the due date.”

Apart from the above constraint() method, you can implement the package’s Constraintable interface:

1use BinarcodeLaravelMailatorConstraintsConstraintable;

2 

3class InvoiceReminderMailable extends Mailable implements Constraintable

4{

5 public function constraints(): array

6 {

7 return [

8 new DynamicContraint

9 ];

10 }

11}

This package also includes an email templating feature, which you can learn more about in the package readme. You can learn more about this package on GitHub: BinarCode/laravel-mailator.

Credit: Source link

Previous Next
Close
Test Caption
Test Description goes like this