if i change template text from admin panel and use that email template in custom email then email is sending but it shows old data only not showing my text even after it is saved in database.
$alltemplele = $this->_objectManager->get('\Magento\Email\Model\Template')->load(7);
$emailTemplate = $alltemplele->getData('orig_template_code');
$storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
$transport = $this->_transportBuilder
// ->setTemplateIdentifier('send_email_email_template') // this code we have mentioned in the email_templates.xml
->setTemplateIdentifier($emailTemplate)
->setTemplateOptions(
[
'area' => \Magento\Framework\App\Area::AREA_FRONTEND, // this is using frontend area to get the template file
'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
]
)
->setTemplateVars(['data' => $postObject])
->setFrom($sender)
->addTo('[email protected]','paras')
->getTransport();
$transport->sendMessage();
Can anyone help me how can I get latest text or changes in email template?
Any help would be appreciated.
Thanks In advance..!
this is my admin template content : {{template config_path="design/email/header_template"}}
{{trans "Custom Email for subcription"}}
{{template config_path="design/email/footer_template"}}
$postObject
where this variable come from