Support sending reminder emails through the API

This commit is contained in:
Hillel Coren 2017-08-29 20:36:08 +03:00
parent e32632cd9a
commit b534ad4e83
2 changed files with 3 additions and 1 deletions

View File

@ -206,7 +206,8 @@ class InvoiceApiController extends BaseAPIController
if ($invoice->is_recurring && $recurringInvoice = $this->invoiceRepo->createRecurringInvoice($invoice)) { if ($invoice->is_recurring && $recurringInvoice = $this->invoiceRepo->createRecurringInvoice($invoice)) {
$invoice = $recurringInvoice; $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)); //$this->dispatch(new SendInvoiceEmail($invoice));
} }
} }

View File

@ -93,6 +93,7 @@ Options
The following options are available when creating an invoice. The following options are available when creating an invoice.
- ``email_invoice``: Email the invoice to the client. - ``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. - ``auto_bill``: Attempt to auto-bill the invoice using stored payment methods or credits.
- ``paid``: Create a payment for the defined amount. - ``paid``: Create a payment for the defined amount.