diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 350869fec8..b293ccef40 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -289,10 +289,10 @@ class InvoiceApiController extends BaseAPIController return $this->errorResponse(['message'=>'Invoice does not exist.'], 400); - $emailResponse = $this->mailer->sendInvoice($invoice, false, false); + $this->mailer->sendInvoice($invoice, false, $invoice->getPDFString()); - if($emailResponse === FALSE) { + if($error) { return $this->errorResponse(['message'=>'There was an error sending the invoice'], 400); } else { diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index a5861ab94a..8959602ce6 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -41,8 +41,6 @@ class ContactMailer extends Mailer $client = $invoice->client; $account = $invoice->account; - $response = false; - if ($client->trashed()) { return trans('texts.email_errors.inactive_client'); } elseif ($invoice->trashed()) {