Allow bulk email with selecting a template

This commit is contained in:
David Bomba 2022-11-23 12:37:39 +11:00
parent 15b4d17bcc
commit 161b6a6466

View File

@ -777,7 +777,7 @@ class InvoiceController extends BaseController
case 'email': case 'email':
//check query parameter for email_type and set the template else use calculateTemplate //check query parameter for email_type and set the template else use calculateTemplate
if (request()->has('email_type') && property_exists($invoice->company->settings, request()->input('email_type'))) { if (request()->has('email_type') && in_array(request()->input('email_type'), ['reminder1', 'reminder2', 'reminder3', 'reminder_endless', 'custom1', 'custom2', 'custom3'])) {
$this->reminder_template = $invoice->client->getSetting(request()->input('email_type')); $this->reminder_template = $invoice->client->getSetting(request()->input('email_type'));
} else { } else {
$this->reminder_template = $invoice->calculateTemplate('invoice'); $this->reminder_template = $invoice->calculateTemplate('invoice');