alright, I think I've found the source of the issue. In:
includes/modules/payment/paypallwpp.php
In the method ec_step2_finish there is section for handling creating accounts for new users that don't have one. The bit I'm looking at is:
// send Welcome Email if appropriate
if ($this->new_acct_notify == 'Yes') {
// require the language file
global $language_page_directory, $template_dir;
if (!isset($language_page_directory)) $language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
if (file_exists($language_page_directory . $template_dir . '/create_account.php')) {
$template_dir_select = $template_dir . '/';
} else {
$template_dir_select = '';
}
require($language_page_directory . $template_dir_select . '/create_account.php');
// set the mail text
$email_text = sprintf(EMAIL_GREET_NONE, $paypal_ec_payer_info['payer_firstname']) . EMAIL_WELCOME . EMAIL_TEXT;
$email_text .= "\n\n" . EMAIL_EC_ACCOUNT_INFORMATION . "\nUsername: " . $paypal_ec_payer_info['payer_email'] . "\nPassword: " . $password . "\n\n";
$email_text .= EMAIL_CONTACT;
// send the mail
zen_mail($paypal_ec_payer_info['payer_firstname'] . " " . $paypal_ec_payer_info['payer_lastname'], $paypal_ec_payer_info['payer_email'], EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>nl2br($email_text)), 'welcome');
// set the express checkout temp -- false means the account is no longer "only" for EC ... it'll be permanent
$_SESSION['paypal_ec_temp'] = false;
} else {
// Make it a temporary account that'll be deleted once they've checked out
$sql = "UPDATE " . TABLE_CUSTOMERS . "
SET customers_paypal_ec = 1
WHERE customers_id = :custID ";
$sql = $db->bindVars($sql, ':custID', $customer_id, 'integer');
$db->Execute($sql);
// set the boolean ec temp value since we created account strictly for EC purposes
$_SESSION['paypal_ec_temp'] = true;
}
Which does send the welcome email to the customer but doesn't even check to see if it should send one to the shop. I checked it against :
<shop>/includes/modules/create_account.php
for reference. So What I figure I need to do is insert a section like this one from create_account.php into the paypal code:
// send welcome email
zen_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_NAME, EMAIL_FROM, $html_msg, 'welcome');
// send additional emails
if (SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_STATUS == '1' and SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO !='') {
if ($_SESSION['customer_id']) {
$account_query = "select customers_firstname, customers_lastname, customers_email_address, customers_telephone, customers_fax
from " . TABLE_CUSTOMERS . "
where customers_id = '" . (int)$_SESSION['customer_id'] . "'";
$account = $db->Execute($account_query);
}
$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']);
$html_msg['EXTRA_INFO'] = $extra_info['HTML'];
zen_mail('', SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO, SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT . ' ' . EMAIL_SUBJECT,
$email_text . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'welcome_extra');
} //endif send extra emails
But that is a fair chunk of code going into the middle of code that affects how paypal works or doesn't work on my live site so I'd really I'd really appreciate someone with actual real php and zen cart skills to lay that out for me. It is something I'd rather not bodge and fumble my way through.
And if I am on track with that can/should a moderator pop a link to this in the paypal support section? And how would I go about requesting the fix be added to the source?
Cheerio for now,
Alan