Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
869 B
1
Indexable
Never
<?php

namespace App\Jobs;

use App\Models\WorkshopDetails;
use App\Mail\AcceptInvitationWorkshop;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Mail;

class AcceptInvitationWorkshopJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Create a new job instance.
     */
    public function __construct(public WorkshopDetails $workshopDetail)
    {
        //
    }

    /**
     * Execute the job.
     */
    public function handle(): void
    {
        Mail::to($this->workshopDetail->email)
            ->send(new AcceptInvitationWorkshop($this->workshopDetail));
    }
}
Leave a Comment