diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 0d5c0bddc328..7368062168fb 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -85,11 +85,11 @@ class AppServiceProvider extends ServiceProvider ->render(); }); - Form::macro('emailPaymentButton', function ($link = '#') { + Form::macro('emailPaymentButton', function ($link = '#', $label = 'pay_now') { return view('partials.email_button') ->with([ 'link' => $link, - 'field' => 'pay_now', + 'field' => $label, 'color' => '#36c157', ]) ->render(); diff --git a/app/Services/TemplateService.php b/app/Services/TemplateService.php index 2c5d3c64a363..c2dda7ed5428 100644 --- a/app/Services/TemplateService.php +++ b/app/Services/TemplateService.php @@ -74,6 +74,8 @@ class TemplateService '$viewButton' => Form::emailViewButton($invitation->getLink(), $entityType).'$password', '$paymentLink' => $invitation->getLink('payment').'$password', '$paymentButton' => Form::emailPaymentButton($invitation->getLink('payment')).'$password', + '$approveLink' => $invitation->getLink('approve').'$password', + '$approveButton' => Form::emailPaymentButton($invitation->getLink('approve'), 'approve').'$password', '$customClient1' => $client->custom_value1, '$customClient2' => $client->custom_value2, '$customContact1' => $contact->custom_value1, diff --git a/resources/views/partials/email_templates.blade.php b/resources/views/partials/email_templates.blade.php index 7c3fbd1358d0..e4c9c9c0d3cc 100644 --- a/resources/views/partials/email_templates.blade.php +++ b/resources/views/partials/email_templates.blade.php @@ -45,6 +45,8 @@ 'viewButton': viewButton, 'paymentLink': '{{ link_to('#', auth()->user()->account->getBaseUrl() . '/...') }}$password', 'paymentButton': {!! json_encode(Form::flatButton('pay_now', '#36c157')) !!} + '$password', + 'approveLink': '{{ link_to('#', auth()->user()->account->getBaseUrl() . '/...') }}$password', + 'approveButton': {!! json_encode(Form::flatButton('approve', '#36c157')) !!} + '$password', 'autoBill': '{{ trans('texts.auto_bill_notification_placeholder') }}', 'portalLink': "{{ auth()->user()->account->getBaseUrl() . '/...' }}", 'portalButton': {!! json_encode(Form::flatButton('view_portal', '#36c157')) !!}, @@ -96,11 +98,14 @@
-

{{ trans('texts.company_variables') }}

+

{{ trans('texts.client_variables') }}

    @foreach([ - 'account', - 'emailSignature', + 'client', + 'contact', + 'firstName', + 'password', + 'autoBill', ] as $field)
  • ${{ $field }}
  • @endforeach @@ -122,14 +127,11 @@
-

{{ trans('texts.client_variables') }}

+

{{ trans('texts.company_variables') }}

    @foreach([ - 'client', - 'contact', - 'firstName', - 'password', - 'autoBill', + 'account', + 'emailSignature', ] as $field)
  • ${{ $field }}
  • @endforeach @@ -141,6 +143,8 @@ 'viewButton', 'paymentLink', 'paymentButton', + 'approveLink', + 'approveButton', 'portalLink', 'portalButton', ] as $field)