DrByte,
The notifier is NOTIFY_ADMIN_ORDERS_UPDATE_ORDER_END.
The code is too long to post completely, but the observer code summary follows with the actual code of the function calling zen_mail following that. One of the products we sell is memberships to our organization. When the customer prefers to send a check or moneyorder for the order instead of using a credit card, we defer processing the order until we receive the payment. Payment receipt is indicated by setting the order status to "shipped" by an admin. Hence the need to perform some storefront processing in the admin.
First, test to see if the order needs to be processed. If so, query the database to retrieve necessary data. Do some preliminary processing to formulate the email to admin staff. Then call functions to generate a new member number and next membership renewal date, save that data in the database, and set up and send an email to the customer. Finally finish up the email to admin staff and send it.
Note that the email to the customer is html (in the current tests) and the email to the admin staff is text.
The function to create and send the email to the customer is:
Code:
function febt_send_customer_member_number($new_number) {
// input - $new_number: string containing new member number
// requires - $_SESSION['customer_id']
global $db;
// send email to customer with new number
// get email address
$query = $db->Execute("select customers_email_address, customers_lastname, customers_firstname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
$email_text = NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_SALUTATION . $query->fields['customers_firstname'] . ",\n\n" . NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_TEXT1 . "\n\n" . NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_TEXT2 . $new_number . ". " . NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_TEXT3 . "\n\n" . NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_TEXT4 . "\n\n";
$html_msg['EMAIL_SUBJECT'] = "<strong>" . NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_SUBJECT . "</strong><br /><br />";
$html_msg['EMAIL_MESSAGE_HTML'] = NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_SALUTATION . $query->fields['customers_firstname'] . ",<br /><br />" . NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_TEXT1 . "<br /><br />" . NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_TEXT2 . $new_number . ". " . NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_TEXT3 . "<br /><br />" . NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_TEXT4;
zen_mail($query->fields['customers_firstname'] . ' ' . $query->fields['customers_lastname'], $query->fields['customers_email_address'], NEW_MEMBER_NUMBER_NOTIFICATION_EMAIL_SUBJECT, $email_text, STORE_NAME, EMAIL_FROM, $html_msg);
}
The message variables $html_msg and $email_text have been inspected and are correct. A portion of the email showing the template keywords follows.

There are no errors in the log.
Dave
zc 1.5.7c