How can I get the template ID by its template name?
Thanks!
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityUse this below code to get your email template ID by code :
protected $emailTemplate;
public function __construct(
...
\Magento\Email\Model\BackendTemplate $emailTemplate
...
){
...
$this->emailTemplate = $emailTemplate;
...
}
public function yourFunction()
{
$email_template = $this->emailTemplate->load('New Pickup Order', 'template_code');
echo $email_template->getId();
}