I've implemented code on the store side to send a custom email to the customer and a copy to an admin. The email is sent near the end of the order confirmation process and has been working well for years. I now need to send that email from the admin for certain orders when the order status has been updated to shipped instead of from the store side. I've set up an observer triggered at the end of the admin order status update code to set up the custom email and send it. I've used the same functions and defines on both the store and admin sides. But the email sent from the admin side consists of many email keywords instead of the desired text. The keywords appear to be what is expected for order status update emails including $EMAIL_TEXT_STATUS_UPDATED, $EMAIL_TEXT_STATUS_LABEL, through $EMAIL_TEXT_STATUS_PLEASE_REPLY.

The email template for both the store side and admin side is "default". And $html_msg['EMAIL_MESSAGE_HTML'] and $html_msg['EMAIL_SUBJECT'] are set to what I want just prior to calling the zen_mail function in admin. Other data in the email included in the template, such as the store logo, copyright notice, spam notice, and disclosure notice, are sent correctly. It's just the email message and email subject that are incorrect.

I'm stumped. What might be causing the email to not use the subject and message html data? What should I check?

Dave