From 929cb2c0a62fa4cf283e3a0a2f4f7b834afc0f54 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Wed, 3 Jul 2024 19:21:50 +0800 Subject: [PATCH] Test sending welcome voucher email through server --- app/Classes/Jobs/SendWelcomeVoucherEmail.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Classes/Jobs/SendWelcomeVoucherEmail.php b/app/Classes/Jobs/SendWelcomeVoucherEmail.php index 77cc4ddb..b6ef687e 100644 --- a/app/Classes/Jobs/SendWelcomeVoucherEmail.php +++ b/app/Classes/Jobs/SendWelcomeVoucherEmail.php @@ -46,10 +46,10 @@ class SendWelcomeVoucherEmail implements ShouldQueue { $currentDatetime = Carbon::now(); $dateToCompare = Carbon::parse($this->voucher->end_date); - // if (!$this->user->hasAttribute($this->voucher->code."_EMAIL_COUNT") - // && $this->user->rewards->where('voucher_id', $this->voucher->id)->count() > 0 - // && $currentDatetime->isBefore($dateToCompare)) - // { + if (!$this->user->hasAttribute($this->voucher->code."_EMAIL_COUNT") + && $this->user->rewards->where('voucher_id', $this->voucher->id)->count() > 0 + && $currentDatetime->isBefore($dateToCompare)) + { //Key #1 $keyValuePairObject = new KeyValuePairObject( $this->voucher->code."_EMAIL_COUNT", @@ -65,6 +65,6 @@ class SendWelcomeVoucherEmail implements ShouldQueue (App()->make(CreatesKeyValuePair::class))->execute($this->user, $keyValuePairObject); $this->user->notify(new WelcomeVoucherEmail($this->user, $this->voucher)); - //} + } } }