Email code:
public function getNotification() {
return Mage::getStoreConfig('example/general/notification');
}
public function sendEmail() {
$storeId = Mage::app()->getStore()->getId();
$templateId = Mage::helper('example')->getNotification();
$emailTemplate = Mage::getModel('core/email_template')->loadDefault($templateId);
$senderMail = Mage::helper('example')->getEmailAddress();
$senderName = Mage::helper('example')->getName();
$receiver = array(
$senderMail => $senderName,
$authorMail => $authorName
);
$emailTemplate->setTemplateSubject("New Notification Added For ". $productName);
$emailTemplate->setSenderEmail($senderMail, $storeId);
$emailTemplate->setSenderName($senderName, $storeId);
$emailTemplate->send(array_keys($receiver),array_values($receiver), $post);
}
my code in config.xml
<template>
<email>
<general_notification translate="label" module="example">
<label>Notifications</label>
<file>notification.html</file>
<type>html</type>
</general_notification>
</email>
</template>
system.xml
<notification>
<label>Notification send to admin and customer</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>90</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</notification>
Now In System > Transaction Email I m add New template and save that template In config I m get template name but using this template my mail is send but Email is empty. there is no content display