mailable = $mailable; $this->company = $company; $this->to_user = $to_user; $this->sending_method = $sending_method; if ($to_user instanceof ClientContact) { $this->settings = $to_user->client->getMergedSettings(); } else { $this->settings = $this->company->settings; } } public function handle() { /*If we are migrating data we don't want to fire these notification*/ if ($this->company->is_disabled) { return true; } MultiDB::setDb($this->company->db); //if we need to set an email driver do it now $this->setMailDriver(); //send email try { Mail::to($this->to_user->email) ->send($this->mailable); } catch (\Exception $e) { //$this->failed($e); if ($this->to_user instanceof ClientContact) { $this->logMailError($e->getMessage(), $this->to_user->client); } } } }