1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Check archived invoices aren't emailed through the API

This commit is contained in:
Hillel Coren 2017-04-02 11:33:39 +03:00
parent b7cd7c9bff
commit 2f838416b0

View File

@ -309,10 +309,15 @@ class InvoiceApiController extends BaseAPIController
{
$invoice = $request->entity();
$this->dispatch(new SendInvoiceEmail($invoice));
//$this->dispatch(new SendInvoiceEmail($invoice));
$result = app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
if ($result !== true) {
return $this->errorResponse($result, 500);
}
$response = json_encode(RESULT_SUCCESS, JSON_PRETTY_PRINT);
$headers = Utils::getApiHeaders();
$response = json_encode(RESULT_SUCCESS, JSON_PRETTY_PRINT);
return Response::make($response, 200, $headers);
}