Pass content of system messages to HTML Email Template
EmailService->sendEmailByKey() sets the htmlBody property of EmailModel to this:

$emailModel-&gt;htmlBody = "{% extends '{$template}' %}\n".
    "{% set body %}\n".
        $emailModel-&gt;htmlBody.
    "{% 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:

&lt;html&gt;
    &lt;body&gt;
        &lt;div&gt;
            {{ body }}
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;