I’ve actually found the quickest way is to use a ‘find and replace’ command in Dreamweaver and the like. Apply it to the source within ‘magento/app/locale/en_US/template/email’
replace alt="Magento” with alt="your store name”
replace Magento Demo Store with your store name
replace mailto:magento@varien.com with mailto:email@yourstore.com
replace dummyemail@magentocommerce.com with email@yourstore.com
replace (800) DEMO-STORE with (0800) YOUR STORE NUMBER
replace Monday - Friday, 8am - 5pm PST with your own store opening times and timezone
This is actually far easier than mucking about with the templates in the admin interface. Then just upload these files over the top of the existing ones.
I’ve actually found the quickest way is to use a ‘find and replace’ command in Dreamweaver and the like. Apply it to the source within ‘magento/app/locale/en_US/template/email’
replace alt="Magento” with alt="your store name”
replace Magento Demo Store with your store name
replace mailto:magento@varien.com with mailto:email@yourstore.com
replace dummyemail@magentocommerce.com with email@yourstore.com
replace (800) DEMO-STORE with (0800) YOUR STORE NUMBER
replace Monday - Friday, 8am - 5pm PST with your own store opening times and timezone
This is actually far easier than mucking about with the templates in the admin interface. Then just upload these files over the top of the existing ones.
Thanks for this. I eventually came to the same conclusion than messing around with what it is to be honest a messy and disjointed interface. Using a search/replace is much easier. However if you ain’t technical it might be a bit tricky.
Am I correct in thinking that if the changes are made using the find & replace method like this, without mucking about with templates, then if you upgrade Magento, you will have to do all this over again?
Wouldn’t it be nice if you could just enter the pertinent info in the admin interface somewhere (like in the configuration section) and have it echo the correct info. Infact, the store name, the emails, and the phone number are already stored in the SQL!!, everything but the times. It would be an easy fix, but has to happen on the developers end so the upgrades don’t overwrite it.
I think this is very important because it is a convenient change that will affect every single person that uses Magento, unless they use their own templates.
FYI: in addition to replacing (800) DEMO-STORE with your store number, there is also a (800) DEMO-NUMBER that has to be replaced in some of those same email files.
Expanding a bit on benfrain.com and patrickz’s comments if you have linux CLI access it was a bit easier for me to run the below once I knew some of the terms to lookout for.
find ./public_html/store/app/locale/en_US/template/email/ -type f -exec sed -i 's/alt="Magento"/alt="CompanyName"/g' {} \; find ./public_html/store/app/locale/en_US/template/email/ -type f -exec sed -i 's/Magento Demo Store/your-domain.com/g' {} \; find ./public_html/store/app/locale/en_US/template/email/ -type f -exec sed -i 's/mailto:magento@varien.com/webmaster@your-domain.com/g' {} \; find ./public_html/store/app/locale/en_US/template/email/ -type f -exec sed -i 's/dummyemail@magentocommerce.com/webmaster@yyour-domain.com/g' {} \; find ./public_html/store/app/locale/en_US/template/email/ -type f -exec sed -i 's/(800)DEMO-STORE/(800)123-1234/g' {} \; find ./public_html/store/app/locale/en_US/template/email/ -type f -exec sed -i 's/(800)DEMO-NUMBER/(800)123-1234/g' {} \; find ./public_html/store/app/locale/en_US/template/email/ -type f -exec sed -i 's/Monday - Friday, 8am - 5pm PST/24x7/g' {} \; find ./public_html/store/app/locale/en_US/template/email/ -type f -exec sed -i 's/logo_email.gif/logo.gif/g' {} \;
All this hard-coded default text is dumb, considering Magento’s strength is managing multiple stores, each with different names, languages, contacts, etc. Duplicating and editing each template through the Transactional Emails panel is way too cumbersome.
At the very least, email templates should be part of the package hierarchy, not in a core locale folder. Ideally, they use variables that are easy to edit in the backend.
Here are the variables that worked for me:
Templates: app/locale/en_US/template/email/*.html
Variable: {{var customer.store.name}}
Output: Store View Name
Templates: app/locale/en_US/template/email/sales/*.html
Variable: {{var order.getStoreGroupName()}}
Output: Store Name
If you set your Store View Name and Store Name to match your domain name, you can get away with replacements like:
There are two steps to changing emails the usual way…
1) Create a new template from default
2) In the config settings change the setting to use the new template you have created (otherwise it will still use the default). These settings are scattered through the config area but usually make sense.
The other option is to go into the files and change the default files directly… then you don’t have to mess with creating new templates and changing all the settings.. there’s a good thread on this here: http://www.magentocommerce.com/boards/viewreply/69549/ (some people are just replacing the text in all the templates, others are actually switching them to use variables from the store.
Thanks this helped alot, except I found some inconsistencies in the find-and-replaces, ie, (800) DEMO-STORE sometimes is (800) DEMO-NUMBER
Hopefully Magento realizes how dated doing the emails like this are, especially with multiple stores. I would agree this should be fixed in future versions.
Here is a script that will replace most of the DEMO information
run from the magento root directory, this should handles templates in Sales as also templates in email Directory.
The phone number still needs to be set
#!/bin/sh phone=(123)456-7890
find app/locale/en_US/template/email/sales -type f -exec sed -i 's/alt="Magento"/alt="{{var order.getStoreGroupName()}}"/g' {} \; find app/locale/en_US/template/email/sales -type f -exec sed -i 's/Magento Demo Store/{{var order.getStoreGroupName()}} /g' {} \; find app/locale/en_US/template/email/sales -type f -exec sed -i 's/mailto:magento@varien.com/sales@{{var order.getStoreGroupName()}}/g' {} \; find app/locale/en_US/template/email/sales -type f -exec sed -i 's/dummyemail@magentocommerce.com/sales@{{var order.getStoreGroupName()}}/g' {} \;
find app/locale/en_US/template/email -type f -exec sed -i 's/alt="Magento"/alt="{{var customer.store.name}}"/g' {} \; find app/locale/en_US/template/email -type f -exec sed -i 's/Magento Demo Store/{{var customer.store.name}} /g' {} \; find app/locale/en_US/template/email -type f -exec sed -i 's/mailto:magento@varien.com/sales@{{var customer.store.name}}/g' {} \; find app/locale/en_US/template/email -type f -exec sed -i 's/dummyemail@magentocommerce.com/sales@{{var customer.store.name}}/g' {} \;
find app/locale/en_US/template/email -type f -exec sed -i "s/(800)DEMO-STORE/$phone/g" {} \; find app/locale/en_US/template/email -type f -exec sed -i "s/(800)DEMO-NUMBER/$phone/g" {} \; find app/locale/en_US/template/email -type f -exec sed -i "s/(800) DEMO-NUMBER/$phone/g" {} \; find app/locale/en_US/template/email -type f -exec sed -i "s/(800) DEMO-STORE/$phone/g" {} \; find app/locale/en_US/template/email -type f -exec sed -i 's/Monday - Friday, 8am - 5pm PST/24x7/g' {} \; find app/locale/en_US/template/email -type f -exec sed -i 's/logo_email.gif/logo.gif/g' {} \;
I’m having a weird problem, or it’s not even a problem but I can’t fix it.
I wan’t to change the background colors of the items order. Any idea how I do it?
I no it’s simple, well it must be, but I really don’t know where to search..
I’m having a weird problem, or it’s not even a problem but I can’t fix it.
I wan’t to change the background colors of the items order. Any idea how I do it?
I no it’s simple, well it must be, but I really don’t know where to search..
Best regards
L. Nunes
The background colors are embeded in the template files, not in a CSS file. So you’ll need to edit the files in your app/locale/(your language)/email/sales/ folder
The background colors are embeded in the template files, not in a CSS file. So you’ll need to edit the files in your app/locale/(your language)/email/sales/ folder
Hey superdark, thank for the reply!
But no the speficific ones I want are not in the templates.
If I go for example to my new order template and check the line that will bring me the items ordered,I don’t have any background or any colors to change.
Go to app/design/frontend/yourcustomdesign/default/template/email and check every single phtml file for hard-coded color references. The one you want is ...email/order/items.phtml . Unfortunately there are more hard-coded color references that occur in other emails as well. And if that’s not enough, once you get this working try creating an order from the admin panel and you will see the old colors have returned in the customer email. In addition to the magento logo. The reason for this is because the admin looks in the default/default theme instead of your custom theme folder. The way I solved it is to edit those email template files as well. Not a very elegant solution but it works. Just one more thing to redo after an upgrade. (This is all in 1.1.6)