43 lines
823 B
PHP
43 lines
823 B
PHP
<?php
|
|
|
|
namespace App\Jobs\Mails;
|
|
|
|
use App\Mail\TenantDeleted;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
class SendTenantDeletedMail implements ShouldQueue
|
|
{
|
|
use Dispatchable;
|
|
use InteractsWithQueue;
|
|
|
|
/**
|
|
* Name of the deleted tenant.
|
|
*
|
|
* @var string
|
|
* */
|
|
private $name;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @param string $name
|
|
* @return void
|
|
*/
|
|
public function __construct(string $name)
|
|
{
|
|
$this->name = $name;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle(): void
|
|
{
|
|
Mail::to(config('mail.to.address'))->send(new TenantDeleted($this->name));
|
|
}
|
|
}
|