40 lines
986 B
PHP
40 lines
986 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Mail\ReplyToMail;
|
|
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 ReplyToMailJob implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*/
|
|
private $citizenEmail;
|
|
private $content;
|
|
private $siteLogo;
|
|
public function __construct($citizenEmail, $content, $siteLogo)
|
|
{
|
|
$this->citizenEmail = $citizenEmail;
|
|
$this->content = $content;
|
|
$this->siteLogo = $siteLogo;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*/
|
|
public function handle()
|
|
{
|
|
Mail::to($this->citizenEmail)
|
|
->send((new ReplyToMail(content: $this->content, siteLogo:$this->siteLogo))
|
|
->replyTo($this->citizenEmail));
|
|
}
|
|
}
|