From b534ad4e8337d93f5125d3ad0bb9ae26465f14ca Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 29 Aug 2017 20:36:08 +0300 Subject: [PATCH] Support sending reminder emails through the API --- app/Http/Controllers/InvoiceApiController.php | 3 ++- docs/api.rst | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 83d67440a1df..d3e758b08eda 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -206,7 +206,8 @@ class InvoiceApiController extends BaseAPIController if ($invoice->is_recurring && $recurringInvoice = $this->invoiceRepo->createRecurringInvoice($invoice)) { $invoice = $recurringInvoice; } - app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice); + $reminder = isset($data['email_type']) ? $data['email_type'] : false; + app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice, $reminder); //$this->dispatch(new SendInvoiceEmail($invoice)); } } diff --git a/docs/api.rst b/docs/api.rst index d681f81a409b..95b8dfdcae99 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -93,6 +93,7 @@ Options The following options are available when creating an invoice. - ``email_invoice``: Email the invoice to the client. +- ``email_type``: Set to reminder1, reminder2 or reminder3 to use the reminder template. - ``auto_bill``: Attempt to auto-bill the invoice using stored payment methods or credits. - ``paid``: Create a payment for the defined amount.