最近使用Newsletter的时候发现做的模板没法带到队列里面,生成的队列内容是空的,解决方案如下:
打开Mage_Adminhtml_Block_Newsletter_Queue_Edit_Form ,大概131-163行,把如下代码
if (in_array($queue->getQueueStatus(), array( Mage_Newsletter_Model_Queue::STATUS_NEVER, Mage_Newsletter_Model_Queue::STATUS_PAUSE))) { $widgetFilters = array('is_email_compatible' => 1); $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('widget_filters' => $widgetFilters)); if ($queue->getTemplate()->isPlain()) { $wysiwygConfig->setEnabled(false); } $fieldset->addField('text','editor', array( 'name' => 'text', 'label' => Mage::helper('newsletter')->__('Message'), 'state' => 'html', 'required' => true, 'value' => $queue->getTemplate()->getTemplateTextPreprocessed(), 'style' => 'width:98%; height: 600px;', 'config' => $wysiwygConfig )); } else { $fieldset->addField('text','text', array( 'name' => 'text', 'label' => Mage::helper('newsletter')->__('Message'), 'value' => $this->getUrl('*/newsletter_template/preview', array( 'id' => $queue->getTemplate()->getId() )) )); $form->getElement('text')->setRenderer(Mage::getModel('adminhtml/newsletter_renderer_text')); $form->getElement('subject')->setDisabled('true'); $form->getElement('sender_name')->setDisabled('true'); $form->getElement('sender_email')->setDisabled('true'); $form->getElement('stores')->setDisabled('true'); }
替换成
if (in_array($queue->getQueueStatus(), array( Mage_Newsletter_Model_Queue::STATUS_NEVER, Mage_Newsletter_Model_Queue::STATUS_PAUSE)) && $queue->getQueueStatus()!="") { $widgetFilters = array('is_email_compatible' => 1); $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('widget_filters' => $widgetFilters)); if ($queue->getTemplate()->isPlain()) { $wysiwygConfig->setEnabled(false); } $fieldset->addField('text','editor', array( 'name' => 'text', 'label' => Mage::helper('newsletter')->__('Message'), 'state' => 'html', 'required' => true, 'value' => $queue->getTemplate()->getTemplateTextPreprocessed(), 'style' => 'width:98%; height: 600px;', 'config' => $wysiwygConfig )); } else { $widgetFilters = array('is_email_compatible' => 1); $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('widget_filters' => $widgetFilters)); if ($queue->getTemplate()->isPlain()) { $wysiwygConfig->setEnabled(false); } $fieldset->addField('text','editor', array( 'name' => 'text', 'label' => Mage::helper('newsletter')->__('Message'), 'state' => 'html', 'required' => true, 'value' => $queue->getTemplate()->getTemplateText(), 'style' => 'width:98%; height: 600px;', 'config' => $wysiwygConfig )); }
问题解决