NNTmux /
newznab-tmux
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App\Jobs; |
||
| 4 | |||
| 5 | use App\Mail\SendInvite; |
||
| 6 | use Illuminate\Bus\Queueable; |
||
| 7 | use Illuminate\Contracts\Queue\ShouldQueue; |
||
| 8 | use Illuminate\Foundation\Bus\Dispatchable; |
||
| 9 | use Illuminate\Queue\InteractsWithQueue; |
||
| 10 | use Illuminate\Queue\SerializesModels; |
||
| 11 | use Illuminate\Support\Facades\Mail; |
||
| 12 | |||
| 13 | class SendInviteEmail implements ShouldQueue |
||
| 14 | { |
||
| 15 | use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 16 | |||
| 17 | private $email; |
||
| 18 | |||
| 19 | private $userId; |
||
|
0 ignored issues
–
show
|
|||
| 20 | |||
| 21 | private $url; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var \App\Models\User |
||
| 25 | */ |
||
| 26 | private $user; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * SendInviteEmail constructor. |
||
| 30 | */ |
||
| 31 | public function __construct($email, $user, $url) |
||
| 32 | { |
||
| 33 | $this->email = $email; |
||
| 34 | $this->user = $user; |
||
| 35 | $this->url = $url; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Execute the job. |
||
| 40 | */ |
||
| 41 | public function handle(): void |
||
| 42 | { |
||
| 43 | Mail::to($this->email)->send(new SendInvite($this->user, $this->url)); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |