33 lines
576 B
PHP
33 lines
576 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Mail\Newsletter;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Queue\Queueable;
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
class SendNewsletterJob implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
public $data;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*/
|
|
public function __construct($data)
|
|
{
|
|
$this->data = $data;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
* testing
|
|
*/
|
|
public function handle(): void
|
|
{
|
|
Mail::to($this->data['email'])->send(new Newsletter($this->data));
|
|
}
|
|
}
|