/** * Execute the command. */ public function handle() { $emails = $this->project->notifyEmails; if ($emails->count() > 0) { $status = strtolower($this->project->getPresenter()->readable_status); $subject = Lang::get('notifyEmails.subject', ['status' => $status, 'project' => $this->project->name]); $deploymentArr = $this->deployment->toArray(); $deploymentArr['commitURL'] = $this->deployment->commit_url; $deploymentArr['shortCommit'] = $this->deployment->short_commit; $data = ['project' => $this->project->toArray(), 'deployment' => $deploymentArr]; Mail::queueOn('deployer-low', 'emails.deployed', $data, function (Message $message) use($emails, $subject) { foreach ($emails as $email) { $message->to($email->email, $email->name); } $message->subject($subject); }); } }