Skip to content

This extension enables the merchants and developers to preview mail templates from the backend with real data.

Notifications You must be signed in to change notification settings

kalenjordan/E-MailPreview

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hackathon EmailPreview

This extension enables the merchants and developers to preview mail templates from the backend with real data.

Facts

Description

This extension enables the merchants and developers to preview mail templates from the backend with real data.

Extending

Extending existing mail templates

If you introduce new variables into existing mail templates, you have to provide Magento with actual models (ie. orders, customers, ...).

You can do so by observing the hackathon_emailpreview_render_email_before event. You will be provided with:

  • templateType. Use the template type to decide if you have to modify the parameters for this type of template.
  • templateParams. This Varien_Object contains the parameters (ie. variables like orders, customers, ...) that will be passed to the mail template renderer.

Adding a customer with real data as a template parameter looks like this:

$templateParams = $observer->getEvent()->getData('templateParams');
$requestParams = $templateParams->getRequestParams();
$customerId = $requestParams['customerId'];
$customer = Mage::getModel('customer/customer')->load($customerId);
$templateParams->setCustomer($customer);

Requirements

  • PHP >= 5.2.0
  • Mage_Adminhtml

Compatibility

  • Magento CE >= 1.7.0.2 (only tested on this version)

Installation Instructions

  1. Install the extension by copying the files into your Magento root or by using a modman compatible tool (modman, Composer).
  2. Clear the cache, logout from the admin panel and then login again.

Uninstallation

  1. Remove the extension by removing the files.

Support

If you have any issues with this extension, open an issue on GitHub.

Contribution

Any contribution is highly appreciated. The best way to contribute code is to open a pull request on GitHub.

Developer

Matthias Zeis http://www.matthias-zeis.com
@mzeis

Marc Päpper http://www.lemundo.de @mpaepper

Tobias Hille

License

OSL - Open Software Licence 3.0

About

This extension enables the merchants and developers to preview mail templates from the backend with real data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%