Files
newznab-tmux/app/Jobs/SendAccountDeletedEmail.php
T
DariusIII 8c11a6c38a Apply fixes from StyleCI
[ci skip] [skip ci]
2018-11-13 20:54:24 +00:00

41 lines
886 B
PHP

<?php
namespace App\Jobs;
use App\Models\User;
use App\Models\Settings;
use App\Mail\AccountDeleted;
use Illuminate\Bus\Queueable;
use Illuminate\Support\Facades\Mail;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
class SendAccountDeletedEmail implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private $userId;
/**
* Create a new job instance.
*
* @param \App\Models\User $user
*/
public function __construct(User $user)
{
$this->userId = $user->id;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Mail::to(Settings::settingValue('site.main.email'))->send(new AccountDeleted($this->userId));
}
}