From b0cfcf7748dbaff039a651fc3eca52f3e25993f9 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 18 Dec 2016 21:39:25 +0200 Subject: [PATCH] Notify on billing completion --- app/Console/Commands/ChargeRenewalInvoices.php | 8 ++++++++ app/Console/Commands/SendRenewalInvoices.php | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/app/Console/Commands/ChargeRenewalInvoices.php b/app/Console/Commands/ChargeRenewalInvoices.php index 0241afc06391..0e9ef0e4c071 100644 --- a/app/Console/Commands/ChargeRenewalInvoices.php +++ b/app/Console/Commands/ChargeRenewalInvoices.php @@ -90,6 +90,14 @@ class ChargeRenewalInvoices extends Command } $this->info('Done'); + + if ($errorEmail = env('ERROR_EMAIL')) { + \Mail::raw('EOM', function ($message) use ($errorEmail) { + $message->to($errorEmail) + ->from(CONTACT_EMAIL) + ->subject('ChargeRenewalInvoices: Finished successfully'); + }); + } } /** diff --git a/app/Console/Commands/SendRenewalInvoices.php b/app/Console/Commands/SendRenewalInvoices.php index 6ed81a1183de..acd3c6f8e14a 100644 --- a/app/Console/Commands/SendRenewalInvoices.php +++ b/app/Console/Commands/SendRenewalInvoices.php @@ -98,6 +98,14 @@ class SendRenewalInvoices extends Command } $this->info('Done'); + + if ($errorEmail = env('ERROR_EMAIL')) { + \Mail::raw('EOM', function ($message) use ($errorEmail) { + $message->to($errorEmail) + ->from(CONTACT_EMAIL) + ->subject('SendRenewalInvoices: Finished successfully'); + }); + } } /**