0

I have added an editor field in one of the custom forms by following code.

//Editor configuration    
$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array(            
    'add_variables' => false,
    'add_widgets' => false,
    'add_images' => false,
    'files_browser_window_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index')
 ));

//Editor field
$fieldset->addField('text', 'editor', array(
    'label'     => Mage::helper('masters')->__('Template Content'),
    'class'     => 'required-entry',
    'required'  => true,
    'name'      => 'text',
    'config'    => $wysiwygConfig,
    'wysiwyg'   => true
));

It displays images correctly in admin. But when I email content of editor field, images are not displayed. I tried to inspect image URL in email window and I got

http://localhost/magento/index.php/admin/cms_wysiwyg/directive/___directive/ef3tftZWfRpYSfBf1cffmw9Ind3eWcvdGf,/key/512fg8a4e56b1e6/

What am I doing wrong?

2
  • why is it localhost? Jun 20, 2015 at 11:56
  • I have replaced my actual domain with localhost/magento Jun 20, 2015 at 12:03

1 Answer 1

0

Try to filter the WYSIWYG editor value by following code

Mage::helper('cms')->getBlockTemplateProcessor()->filter('your WYSIWYG editor value');

Then append that value to the email content.

Hope this may help to you.

1
  • Thanks for your suggestion but it is also not working. I have found an alternative solution though. I have modified browser.js and overriden Mage_Cms_Helper_Wysiwyg_Images helper file to get desired URL Jun 22, 2015 at 6:55

Your Answer

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

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