const XML_PATH_EMAIL_RECIPIENT = 'quotes/email/recipient_email';
const XML_PATH_EMAIL_SENDER = 'quotes/email/sender_email_identity';
const XML_PATH_EMAIL_TEMPLATE = 'quotes/email/email_template';
$mailTemplate = Mage::getModel('core/email_template');
/* @var $ mailTemplate Mage_Core_Model_Email_Template */
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
->sendTransactional(
Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT),
null,
array('data' => $postObject)`
);
這應該允許您根據需要發送的模板。
你需要在你的config.xml
<template>
<email>
<quotes_email_email_template translate="label" module="quotes">
<label>Quote Form</label>
<file>quote_form.html</file>
<type>text</type>
</quotes_email_email_template>
</email>
</template>
<default>
<quotes>
<quotes>
<enabled>1</enabled>
</quotes>
<email>
<recipient_email><![CDATA[[email protected]]]></recipient_email>
<sender_email_identity>custom2</sender_email_identity>
<email_template>quotes_email_email_template</email_template>
</email>
</quotes>
</default>
這是Mage_Quotes模塊,允許一個表格發送報價的產品的一個實例XML的該位。
您的帖子是正確的,但我追查它是一個錯誤與我本地的wamp設置和一個SMTP錯誤。我的方法在我的製作網站上運行良好。雖然謝謝! – 2012-04-02 17:41:54