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


What am I doing wrong?

  • why is it localhost? – Claudiu Creanga Jun 20 '15 at 11:56
  • I have replaced my actual domain with localhost/magento – piyush_systematix Jun 20 '15 at 12:03

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.

  • 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 – piyush_systematix Jun 22 '15 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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