In this post I would like to share the idea of overriding default email templates in a programmatic way and on per design basis. So, you can copy email templates from
app/design/frontend/<yourInterface>/default/locale/en_US/template/email and modify them as you like.
NOTE: I’ll use naming from some real project, i.e. you most likely will need to change
TJU_ prefix and
tjuInterface to the name of your design package. This has been tested with magento 1.3.1 and might not work(or to be different) for others versions.
Step 1. Override Translate model
Translate model “responsible” for the path to email templates, see
getTemplateFile method in
app/code/core/Mage/Core/Model/Translate.php. We will be creating 3 files to extend it’s default functionality:
1.1 Create Translate model class in
1.2 Configure magento to use your class instead of default one. Create
1.3 Enable our module. Create
1.4 Clear cache, just
rm -rf var/* for now ;)
Step 2. Modify email templates
Now copy email templates from
app/design/frontend/tjuInterface/default/locale/en_US/template/email and modify them as you like.
I also found nice script which helps to override all dummy data at once, take a look, pls. For some reason it did not work out of box for me, with magento 1.3.1, so I made some adjustments, see below.
email.sh file and make it executable.