From 43ca2c72d12c2d52f06b4b0a3518d8f768f73db2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 5 Sep 2022 08:19:03 +1000 Subject: [PATCH] Add check if plan is expired --- app/Mail/SupportMessageSent.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Mail/SupportMessageSent.php b/app/Mail/SupportMessageSent.php index 9d91ba9fd06d..5278d495cf84 100644 --- a/app/Mail/SupportMessageSent.php +++ b/app/Mail/SupportMessageSent.php @@ -70,8 +70,13 @@ class SupportMessageSent extends Mailable $trial = $account->isTrial() ? 'T' : ''; $plan = str_replace('_', ' ', $plan); + $plan_status = ''; + + if(Carbon::parse($account->plan_expires)->lt(now())) + $plan_status = 'Plan Expired'; + if (Ninja::isHosted()) { - $subject = "{$priority}Hosted-{$db}-{$is_large}{$platform}{$migrated}{$trial} :: {$plan} :: ".date('M jS, g:ia'); + $subject = "{$priority}Hosted-{$db}-{$is_large}{$platform}{$migrated}{$trial} :: {$plan} :: {$plan_status} ".date('M jS, g:ia'); } else { $subject = "{$priority}Self Hosted :: {$plan} :: {$is_large}{$platform}{$migrated} :: ".date('M jS, g:ia'); }