Merge branch 'dillon/63-voucherify-updates' into 'master'

Test sending welcome voucher email through server

See merge request CIEFWorldwideSdnBhd/exchange-2.0!164
This commit is contained in:
Dillon Ngo
2024-07-03 11:22:27 +00:00
+5 -5
View File
@@ -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));
//}
}
}
}