I have create one custom module and in this module I have created send email functionality. But In Email header and footer is not send.
So Please help me.
THANKS.
If you are use send email functionally using controller and other like :-
My Old code is not working header and footer
$transport = $this->transportBuilder
->setTemplateIdentifier('admin_customerapprove_template')
->setTemplateOptions(
[
'area' => \Magento\Framework\App\Area::AREA_FRONTEND,
'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
]
)
->setTemplateVars([
'customerName' => $customerFirstName ,
'customerEmail' => $customerEmail,
])
->setFrom($sender)
->addTo($emailSender)
->getTransport();
$transport->sendMessage();
$this->inlineTranslation->resume();
After i have find some solution like :-
for
'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID
use
'store' => $this->storeManager->getStore()->getId()
And How to create object for storeManager follow below link :-
https://www.mageplaza.com/devdocs/how-get-store-information-magento-2.html
Hope this help other.
THANKS.