Giter Club home page Giter Club logo

e-mailpreview's Introduction

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.

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.

Usage

The functionality can be used in the backend section System > Transactional Emails.

  • Click on a template in the transaction email grid and navigate to the Preview Email tab.
  • Choose the Template type. This is necessary because an e-mail template is not fixed to a certain template type. For example you load a New account template and select the Template type New account.
  • Unfortunately, you have do use common sense to find out which data are necessary for which template at the moment. It doesn't harm if you enter more data than necessary so if you're in doubt fill in more fields.

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);

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

License

OSL - Open Software Licence 3.0

e-mailpreview's People

Contributors

daim2k5 avatar kalenjordan avatar mklooss avatar mzeis avatar peterjaap avatar quafzi avatar tobihille avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

e-mailpreview's Issues

Code clean-up

Before we create the next release, we should do a bit of code-cleanup.

Preview templates in files

At the moment it is only possible to preview templates which are saved in the database. It would be great to preview "standard" templates - the ones which are saved in /order/email/...

Ease data providing

The user interface for providing data to the templates could be improved. For now, we show all input elements / variables which are used in any of the templates. This is static, not dynamic and not expandable at the moment.

Some possible approaches:

  • Show hints which parameters are needed for the selected preview type
  • Hide not needed parameters
  • Parse template code to find variables that are used in the template

Fatal error when try to preview New Invoice mail

When I try to preview the "New Invoice" or "New shipment", I get the following error:

Fatal error: Call to a member function getMethodInstance() on boolean in app/code/core/Mage/Payment/Helper/Data.php on line 119

Any other previews works fine.

Magento 1.9.1.0

cannot install package via composer, getting this error all the time

Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package magento-hackathon/e-mail-preview could not be found in any version, there may be a typo in the package name.

Potential causes:

Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.