Hintergründe zum EventInvitePage Layout Customizer hinzugefügt. Badge und CTA entfernt, Textfelder zu Textareas gemacht. Geschenkgutscheine verbessert, E-Mail-Versand ergänzt + Resend + Confirmationseite mit Code-Copy und Link zur Package-Seite, die den Code als URL-Parameter enthält.
This commit is contained in:
40
app/Jobs/NotifyGiftVoucherReminder.php
Normal file
40
app/Jobs/NotifyGiftVoucherReminder.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Mail\GiftVoucherIssued;
|
||||
use App\Models\GiftVoucher;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class NotifyGiftVoucherReminder implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function __construct(public GiftVoucher $voucher, public bool $expiry = false) {}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$voucher = $this->voucher->fresh();
|
||||
|
||||
if (! $voucher || $voucher->isRedeemed() || $voucher->isRefunded() || $voucher->isExpired()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$recipients = collect([$voucher->purchaser_email, $voucher->recipient_email])
|
||||
->filter()
|
||||
->unique()
|
||||
->all();
|
||||
|
||||
foreach ($recipients as $email) {
|
||||
Mail::to($email)->queue((new GiftVoucherIssued($voucher, $email === $voucher->recipient_email))->with([
|
||||
'isReminder' => true,
|
||||
'isExpiry' => $this->expiry,
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user