From ca32aa9b9f73b01efa7b1c1abb274f5456ffed17 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 15 Mar 2019 16:19:29 -0400 Subject: [PATCH] Updating replacement variables for when billing contact name enabled If enabled it must use billing contact name not first and last. --- classes/notifications.php | 6 +++++ .../admin/settings/editNotificationType.html | 23 ++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/classes/notifications.php b/classes/notifications.php index 986a244..51a512e 100644 --- a/classes/notifications.php +++ b/classes/notifications.php @@ -132,6 +132,12 @@ class GlmNotifications 'phone' => $account['billing_phone'], ) ); + if ( $this->config['settings']['billing_contact_name_enabled'] ) { + $account_data['account']['contact_name'] = $account['billing_contact_name']; + } else { + $account_data['account']['first_name'] = $account['billing_fname']; + $account_data['account']['last_name'] = $account['billing_lname']; + } // Merge any data passed into this method $account_data['data'] = $data; diff --git a/views/admin/settings/editNotificationType.html b/views/admin/settings/editNotificationType.html index 1b441da..9512be7 100644 --- a/views/admin/settings/editNotificationType.html +++ b/views/admin/settings/editNotificationType.html @@ -145,14 +145,21 @@ {literal}{$account.name}{/literal} Name of Account - - {literal}{$account.first_name}{/literal} - Billing First Name - - - {literal}{$account.last_name}{/literal} - Billing Last Name - + {if $settings.billing_contact_name_enabled} + + {literal}{$account.contact_name}{/literal} + Billing Contact Name + + {else} + + {literal}{$account.first_name}{/literal} + Billing First Name + + + {literal}{$account.last_name}{/literal} + Billing Last Name + + {/if} {literal}{$account.addr1}{/literal} Billing Address 1 -- 2.17.1