From cc49415a7830b860ca4ecc2976ed572b20c69262 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 3 Feb 2016 22:10:09 +0200 Subject: [PATCH] Added invoiceDate as email template variable --- app/Ninja/Mailers/ContactMailer.php | 6 ++++-- resources/lang/en/texts.php | 3 ++- resources/views/accounts/templates_and_reminders.blade.php | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index 5e75a81120ad..3c715c6f2d61 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -19,13 +19,14 @@ class ContactMailer extends Mailer public static $variableFields = [ 'footer', 'account', + 'dueDate', + 'invoiceDate', 'client', 'amount', 'contact', 'firstName', 'invoice', 'quote', - 'dueDate', 'viewLink', 'viewButton', 'paymentLink', @@ -234,13 +235,14 @@ class ContactMailer extends Mailer '$footer' => $account->getEmailFooter(), '$client' => $client->getDisplayName(), '$account' => $account->getDisplayName(), + '$dueDate' => $account->formatDate($invoice->due_date), + '$invoiceDate' => $account->formatDate($invoice->invoice_date), '$contact' => $invitation->contact->getDisplayName(), '$firstName' => $invitation->contact->first_name, '$amount' => $account->formatMoney($data['amount'], $client), '$invoice' => $invoice->invoice_number, '$quote' => $invoice->invoice_number, '$link' => $invitation->getLink(), - '$dueDate' => $account->formatDate($invoice->due_date), '$viewLink' => $invitation->getLink(), '$viewButton' => HTML::emailViewButton($invitation->getLink(), $invoice->getEntityType()), '$paymentLink' => $invitation->getLink('payment'), diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 47524743b630..6c933cd63bda 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -1141,6 +1141,7 @@ return array( 'all_pages_header' => 'Show header on', 'all_pages_footer' => 'Show footer on', 'invoice_currency' => 'Invoice Currency', - 'enable_https' => 'We strongly recommend using HTTPS to accept payments online.' + 'enable_https' => 'We strongly recommend using HTTPS to accept credit card details online.', + ); diff --git a/resources/views/accounts/templates_and_reminders.blade.php b/resources/views/accounts/templates_and_reminders.blade.php index 6b88ab70f9be..2794a5b2e0f8 100644 --- a/resources/views/accounts/templates_and_reminders.blade.php +++ b/resources/views/accounts/templates_and_reminders.blade.php @@ -203,13 +203,14 @@ var vals = [ {!! json_encode($emailFooter) !!}, "{{ $account->getDisplayName() }}", + "{{ $account->formatDate($account->getDateTime()) }}", + "{{ $account->formatDate($account->getDateTime()) }}", "Client Name", formatMoney(100), "Contact Name", "First Name", "0001", "0001", - "{{ $account->formatDate($account->getDateTime()) }}", "{{ URL::to('/view/...') }}", '{!! HTML::flatButton('view_invoice', '#0b4d78') !!}', "{{ URL::to('/payment/...') }}",