0

How can I get the template ID by its template name?

enter image description here

Thanks!

1

Use 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->getTemplateId();  
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.