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)); - //} + } } }