template = $template; $this->posts = $posts; $this->title = $title; $this->count = $count; $this->debug = $debug; $this->debugText = $debugText; } /** * Execute the job. * * @return void */ public function handle(Mailer $mailer) { $template = $this->template; $posts = $this->posts; $title = $this->title; $count = $this->count; $debugText = $this->debugText; $admin = User::select('email') ->where('name', 'Admin') ->get(); $email = $admin[0]->email; $emailFrom = config('mail.from.address'); echo "Sende Bericht an Admin: $email\n"; $mailer->send($template, ['departments' => $posts, 'debugText' => $debugText], function($message) use($email, $count, $title, $emailFrom){ $message->to($email) ->from($emailFrom, "Feuerwehr Eppingen - Gesamtwehr") ->subject("$title vom ".Carbon::now()->format('d.m.Y')." ($count)"); // ->subject("Feuerwehr Eppingen: Gesamtwehr - $title vom ".Carbon::now()->format('d.m.Y')." ($count)"); }); } }