I have created an overwrite for one of the emails using the "transactional Emails" function to customize the html and styles of the email however I cannot find a way to add the following to the top of the emails

<!DOCTYPE html>

In the backend it starts at the body tag and trying to add html tags or doctype do not work as I'm assuming something is combining the body with the css and adding the html tags.

I cannot find what file/function is adding the tags around this to try and add the doctype into.


I went through the mailsending process:

You can just put <!DOCTYPE html> into the input box of the transactional e-mail templates in the the admin area.

Just put it right before the body tag starts:

<!DOCTYPE html>

The <!DOCTYPE html> is not stripped away or something, I tried it.

The file/function that sends the e-mails is the send() function in app/code/Core/Model/Email/Template.php, more precisely in line 447: $mail->setBodyHTML($text);.

I didn't see any other method to add the doctype-declaration otherwise.

  • To modify the mark-up for all email templates for a given locale, edit the header.html in app/locale/lo_Ca/template/email/html/header.html. You can also modify this in the same way you can with other templates (just load the "Email header" in System > Transactional Emails > Add New Template and configure it in System > Configuration > [General:Design] > Transactional Emails. – Melvyn Mar 29 '15 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.