Originally Posted by
lat9
Take a look at /includes/modules/create_account.php, which contains code to send the customer a welcome e-mail when they create an account. This uses the template file /email/email_template_welcome.html if the customer has indicated that s/he wants HTML-formatted e-mail.
Towards the end of the PHP file is where the message is built, starting with the comment "// build the message content". You'll see that a text message string is built as well as the content required for the HTML template, followed by a call to zen_mail (in /includes/functions/functions_email.php) which determines whether to send TEXT or HTML based on the customer's preference in your database.