Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I can set the template in the email settings to use a HTML template but how do I pass the content of the system messages (activate your account, reset your password, etc) to this template?

I've added this to the html template but then the email that is sent is blank:

{% block content %}
{% endblock %}
share|improve this question
up vote 8 down vote accepted

EmailService->sendEmailByKey() sets the htmlBody property of EmailModel to this:

$emailModel->htmlBody = "{% extends '{$template}' %}\n".
    "{% set body %}\n".
    "{% endset %}\n";

So if you've got a custom email template in craft/templates/email.html, in the control panel under Settings → Email → HTML Email Template, you'd set the value to email.html.

And you'd simply output the dynamic email content in your template by using {{ body }} like so:

            {{ body }}
share|improve this answer
Thanks for the reply! – Niall Thompson Aug 3 '14 at 0:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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