I had a slightly different problem but i think it would be good to post the solution here anyway as I came across this post when researching my issue.
I have a custom module that triggers an email on a cron. The header and footer were not being included when the emails were sent.
The header and email templates are only located in the frontend area. See :
As such if your template options state 'adminhtml' or 'crontab' for example it wont find those templates.
In your custom code you will have a section or method containing something like this :
When you set your template options you need to make sure that you set the 'area' to be 'frontend' :
$templateOptions = array(
'area' => \Magento\Framework\App\Area::AREA_FRONTEND,
'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
Equally, if your email template is in adminhtml/templates/email/ it will have to be moved to frontend/templates/email/
** Just want to add that this works on a single store configuration. If you are using multi-store configuration. You will need to pull the store id via a different mechanism, like: