From 2cdf369c04627d4ec724948879ae81b97f21957e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 31 Jan 2017 13:33:46 +0200 Subject: [PATCH] Send email when SendReminders finishes --- app/Console/Commands/SendReminders.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/SendReminders.php b/app/Console/Commands/SendReminders.php index 87151db01897..af5f9bfca2c2 100644 --- a/app/Console/Commands/SendReminders.php +++ b/app/Console/Commands/SendReminders.php @@ -32,7 +32,7 @@ class SendReminders extends Command * @var InvoiceRepository */ protected $invoiceRepo; - + /** * @var accountRepository */ @@ -80,6 +80,14 @@ class SendReminders extends Command } $this->info('Done'); + + if ($errorEmail = env('ERROR_EMAIL')) { + \Mail::raw('EOM', function ($message) use ($errorEmail) { + $message->to($errorEmail) + ->from(CONTACT_EMAIL) + ->subject('SendReminders: Finished successfully'); + }); + } } /**