senderMail = $senderMail; $this->senderName = $senderName; $this->email = $email; $this->title = $title; $this->text = $text; $this->template = $template; } /** * Execute the job. * * @return void */ public function handle(Mailer $mailer) { $senderMail = $this->senderMail; $senderName = $this->senderName; $email = $this->email; $title = $this->title; $text = $this->text; $template = $this->template; $mailer->send($template, ['text' => $text], function ($message) use ($senderMail, $senderName, $email, $title) { $message->to($email) ->from($senderMail, $senderName) ->subject($title); }); } }