I am getting mail content as object instead of HTML content... Here is my Magento Code


//get customer details
$customer = Mage::getSingleton('customer/session')->getCustomer();

//get general store details
$from_name = Mage::getStoreConfig('trans_email/ident_general/name');
$from_email = Mage::getStoreConfig('trans_email/ident_general/email');
$templateId = 7;        // My Email Template ID
$emailTemplate = Mage::getModel('core/email_template')->load($templateId);

$mail = Mage::getModel('core/email');
$mail->setSubject('Sample Mail Subject');
$mail->setFromName("Msg to Show on Subject");

try {
    Mage::getSingleton('core/session')->addSuccess('Your request has been sent');   
catch (Exception $e) {
    Mage::getSingleton('core/session')->addError('Unable to send.');

I want the HTML contents of the template as the output.

Please Help ! Thank you.

1 Answer 1


I think you need to process your template.

$processedTemplate = $emailTemplate->getProcessedTemplate();

I haven't tested though. But should work.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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