Does someone know how do I get the id of an email by name set on backend? I have an email created in backend in transactional emails that I want to send it programatically, but the id of it may differ depending on the instance that I'm on (local, live, stage), and I can only provide the same name for it.
I have this:
Mage::getModel('core/email_template')->sendTransactional(
$templateId,
$sender,
$recepientEmail,
$recepientName,
$vars,
$store);
And I need to find out $templateId and I only know that I saved the mail with name "Tests".
Best Answer
Try calling:
Mage::getModel('core/email_template')->loadByCode('Tests')
if Tests is the name of the template you set up.After that you can set the sender name, sender email etc and send it. Here is some sample code:
$mailTemplate in above sample would be 'Tests' from your example.