Skip to content

Commit

Permalink
Support po number and terms/notes in email templates
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Nov 9, 2018
1 parent 6a5dcbd commit 2a1ec27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Services/TemplateService.php
Expand Up @@ -68,6 +68,9 @@ public function processVariables($template, array $data)
'$quote' => $invoice->invoice_number,
'$number' => $invoice->invoice_number,
'$partial' => $invoice->present()->partial,
'$poNumber' => $invoice->po_number,
'$terms' => $invoice->terms,
'$notes' => $invoice->public_notes,
'$link' => $invitation->getLink(),
'$password' => $passwordHTML,
'$viewLink' => $invitation->getLink().'$password',
Expand Down
6 changes: 6 additions & 0 deletions resources/views/partials/email_templates.blade.php
Expand Up @@ -40,6 +40,9 @@ function renderEmailTemplate(str, invoice, entityType) {
'quote': invoice ? invoice.invoice_number : '0001',
'number': invoice ? invoice.invoice_number : '0001',
'password': passwordHtml,
'poNumber': invoice ? invoice.po_number : '123456',
'terms': invoice ? invoice.terms : "{{ trans('texts.terms') }}",
'notes': invoice ? invoice.public_notes: "{{ trans('texts.notes') }}",
'documents': documentsHtml,
'viewLink': '{{ link_to('#', auth()->user()->account->getBaseUrl() . '/...') }}$password',
'viewButton': viewButton,
Expand Down Expand Up @@ -120,6 +123,9 @@ function renderEmailTemplate(str, invoice, entityType) {
'partial',
'invoiceDate',
'dueDate',
'poNumber',
'terms',
'notes',
'documents',
] as $field)
<li>${{ $field }}</li>
Expand Down

0 comments on commit 2a1ec27

Please sign in to comment.