One of the most 'curious' tasks in getting a Magento eCommerce shop ready to go live is the task of getting all of the email templates altered so that they contain the correct information for your new shop. There are millions of these templates with rather annoying literal strings in 'em like 'Demo Store' etc. For some strange reason the default templates do not pull things like the store name etc. from the (available) backend variables.
We have found that the best way to get these templates changed is not to edit them by hand but to use a script to automatically change the text. We use a shell script based on the one detailed here:
http://www.magentocommerce.com/boards/viewthread/6177/P15/#t69549
See post #26 from a very kind [url=http://www.magentocommerce.com/boards/member/6377/]charlesrg1[/url]
The strange thing is that it seems that over the course of some minor magento releases some of the text in the default templates changed thus breaking part of this script and others like it, for example 'Magento Demo Store' got changed to 'Demo Store'. I am not going to hazard a guess as to why this text was changed (and hence the scripts broken) instead I will include the script that we used sucessfully with magento version 1.3.2.2 in the hope that it might help someone:
<code>
#!/bin/sh
phone="025 46791"
office_hours=""
email="info@{{var order.getStoreGroupName()}}"
locale="en_US"
tpath="app/locale/$locale/template/email"
fops="-type f -exec sed -r -i"
#
find $tpath/sales $fops 's/alt="Magento"/alt="{{var order.getStoreGroupName()}}"/g' {} \;
find $tpath/sales $fops 's/Magento Demo Store/{{var order.getStoreGroupName()}} /g' {} \;
find $tpath/sales $fops 's/Demo Store/{{var order.getStoreGroupName()}} /g' {} \;
find $tpath/sales $fops "s/mailto:magento@varien.com/$email/g" {} \;
find $tpath/sales $fops "s/dummyemail@magentocommerce.com/$email/g" {} \;
find $tpath $fops 's/alt="Magento"/alt="{{var customer.store.name}}"/g' {} \;
find $tpath $fops 's/Magento Demo Store/{{var customer.store.name}} /g' {} \;
find $tpath $fops 's/Demo Store/{{var customer.store.name}} /g' {} \;
find $tpath $fops "s/mailto:magento@varien.com/$email/g" {} \;
find $tpath $fops "s/dummyemail@magentocommerce.com/$email/g" {} \;
find $tpath $fops "s/\(0?800\) ?DEMO-(STORE)|(NUMBER)/$phone/g" {} \;
find $tpath $fops "s/\(555\) 555-0123/$phone/g" {} \;
find $tpath $fops "s/ ?Monday - Friday, 9am - 5pm PST/$office_hours/g" {} \;
find $tpath $fops "s/ ?Monday - Friday, 8am - 5pm PST/$office_hours/g" {} \;
find $tpath $fops 's/logo_email.gif/logo.gif/g' {} \;
</code>
There are variables at the top through which you can specify your store's phone number, office hours and target locale. Also, remember to set the store in the Magento Admin as the templates will now use it.
Remember to back up your templates before throwing the script at them and also that your updated templates may be overwritten if you upgrade your magento installation - so keep a backup of your altered email templates and upload them again after an upgrade (if required).
Let us know if it works ok for you or if you find any problems with it, with the feedback I will try to keep the script current & correct.