
Originally Posted by
linuxguy2
PHP 7.x
ZC 1.5.6a green classic template
The update to 1.56 works GREAT! Thanks!!!
I have been using this plugin for several years now without issues.
However this year when I upgraded to 1.5.6a I am having issues adding the "extrafields" to the customer registration emails.
They are getting entered into the customer account and I am able to view and edit "Customer" information including the "extrafields" in the Admin interface. That tells me the information is getting into the database.
I entered the "extrafields" in email_functions.php as I did last time but the extrafields are not showing up in emails.
All the other customer information is showing up at the bottom of the admin "you have a new account" email like it's supposed to.
I would appreciate a bit of guidance.
Thanks
Problem SOLVED
After many hours of toiling over a smoking keyboard the only logical conclusion was the "extra_info" array wasn't being created.
Hope this helps some other non-coder like myself in the future.
In includes/modules/your_template/create_account.php I hadn't added the necessary code to generate the "extra_info" array
Around line 440
ORIGINAL Code:
Code:
$extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax']);
MODIFIE:Code:
Code:
$extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax'], $company, $extrafield, $extrafield2, $street_address, $suburb, $city, $state, $postcode, $extrafield4);
Then of course this mod in /includes/functions/email_functions.php around line 590
ORIGINAL Code:
Code:
function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $moreinfo = array()) {
MODIFIED Code:
Code:
function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $company='', $extrafield='', $extrafield2='', $street_address='', $suburb='', $city='', $state='', $postcode='', $extrafield4='', $moreinfo = array()) {
AND modify/add: around line 610
Code:
$extra_info['HTML'] = '<table width="100%" class="extra-info">' .
'<tr><td class="extra-info-bold" colspan="2">' . OFFICE_USE . '</td></tr>' .
'<tr><td width="20%" class="extra-info-bold">' . OFFICE_FROM . '</td><td>' . $from . '</td></tr>' .
//'<tr><td class="extra-info-bold">' . OFFICE_EMAIL. '</td><td>' . $email_from . '</td></tr>' .
($login_email !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_EMAIL . '</td><td>' . $login_email . '</td></tr>' : '') .
($login !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_NAME . '</td><td>' . $login . '</td></tr>' : '') .
($company != '' ? '<tr><td class="extra-info-bold">' . OFFICE_COMPANY . '</td><td>' . $company . '</td></tr>' : '') .
($extrafield != '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD . '</td><td>' . $extrafield . '</td></tr>' : '') .
($street_address != '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS . '</td><td>' . $street_address . '</td></tr>' : '') .
($suburb != '' ? '<tr><td class="extra-info-bold">' . OFFICE_STREET_ADDRESS_LINE2 . '</td><td>' . $suburb . '</td></tr>' : '') .
($city != '' ?'<tr><td class="extra-info-bold">' . OFFICE_CITY . '</td><td>' . $city . '</td></tr>' : '') .
($state != '' ? '<tr><td class="extra-info-bold">' . OFFICE_STATE . '</td><td>' . $state . '</td></tr>' : '') .
($postcode != '' ? '<tr><td class="extra-info-bold">' . OFFICE_POSTCODE . '</td><td>' . $postcode . '</td></tr>' : '') .
($login_phone !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_PHONE . '</td><td>' . $login_phone . '</td></tr>' : '') .
($login_fax !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_FAX . '</td><td>' . $login_fax . '</td></tr>' : '') .
($extrafield2 != '' ? '<tr><td width="20%" class="extra-info-bold">' . OFFICE_EXTRAFIELD2 . '</td><td>' . $extrafield2 . '</td></tr>' : '') .
($extrafield4 != '' ? '<tr><td class="extra-info-bold">' . OFFICE_EXTRAFIELD4 . '</td><td>' . $extrafield4 . '</td></tr>' : '') .
'<tr><td class="extra-info-bold">' . " " . '</td><td>' . " " . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_IP_ADDRESS . '</td><td>' . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_HOST_ADDRESS . '</td><td>' . $email_host_address . '</td></tr>' .
'<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>';
Bookmarks