【发布时间】:2015-09-29 09:46:57
【问题描述】:
我需要在编辑器中添加一些默认数据。 就像我希望在单击编辑模板选项时将模板加载到编辑器中一样。 谁能给我一些建议??
【问题讨论】:
-
我猜你是在谈论交易电子邮件?
-
是的,但是在我自己的模块中我该怎么做?
标签: php email magento editor wysiwyg
我需要在编辑器中添加一些默认数据。 就像我希望在单击编辑模板选项时将模板加载到编辑器中一样。 谁能给我一些建议??
【问题讨论】:
标签: php email magento editor wysiwyg
在这里你可以看到它是如何做到的
$dataa= $this->getTemplate1();
$fieldset->addField('content', 'editor', array(
'name' => 'content',
'label' => Mage::helper('abandonedcart')->__('Content'),
'title' => Mage::helper('abandonedcart')->__('Content'),
'style' => 'width:700px; height:500px;',
'wysiwyg' => true,
'required' => true,
'state' => 'html',
'config' => $wysiwygConfig,
'value'=> $dataa,
));
if (Mage::getSingleton('adminhtml/session')->getAbandonedcartData()) {
$form->addValues(Mage::getSingleton('adminhtml/session')->getAbandonedcartData());
Mage::getSingleton('adminhtml/session')->setAbandonedcartData(null);
} elseif (Mage::registry('abandonedcart_data')) {
$form->addValues(Mage::registry('abandonedcart_data')->getData());
}
return parent::_prepareForm();
}
调用函数获取数据
public function getTemplate1() {
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('abandonedcart_abandonedcart_group_email_template');
$emailTemplate['template_text'];;
$template_id = Mage::getStoreConfig('abandonedcart/abandonedcart_group/email_template');
$emailTemplate = Mage::getModel('core/email_template')->loadDefault($template_id);
return $processedTemplate = $emailTemplate->getProcessedTemplate();
}
【讨论】: