where('id', '=', $data['invoice_id'])->get()->first(); if($invoice->account->pdf_email_attachment && file_exists($invoice->getPDFPath())) { $message->attach( $invoice->getPDFPath(), array('as' => $invoice->getFileName(), 'mime' => 'application/pdf') ); } } $message->to($toEmail)->from($fromEmail, $fromName)->replyTo($replyEmail, $fromName)->subject($subject); }); return true; } catch (Exception $e) { $response = $e->getResponse()->getBody()->getContents(); $response = json_decode($response); return nl2br($response->Message); } } }