5

In the email templates we use the email address of the shop ([email protected]), as plain text, and a custom logo with the name of the shop in it (shopname_email.png). Now, for each store, we have to create new templates, and replace logo name and email address. I would like to use one standard template that doesn't have to be changed for each shop.

I would like to use something like {{store.email}} and {{store.code}} in the templates. The store name is not good, as some stores will have names with spaces and special characters, and these names are not fixed, can change in the future. Defining a variable in the admin might be a solution, if that can be used in the templates, but looking at it variable values are fixed for all stores so I think this cannot be used. Something that can produce "shopname" (depending on the store) would do.


Below you see my accepted answer. It's great because that way you can create any value using PHP, like the domain name. I just found out that for me, there is a simpler solution that can be handled in the admin entirely.

  1. Create a custom variable in System > Custom variables
  2. Save this variable, go to the list of custom variables, and open the new variable again.
  3. Now you see that you can change the value of the variable per shop.
  4. Insert the variable in your email template

Et voilà!

2 Answers 2

8

For logo:

There is an email var for that:

{{skin url="images/logo_email.gif" _area='frontend'}}

To make it your own, upload and replace logo_email.gif

For email variables:

Some of these exist by default:

General Store Email address:

{{config path="trans_email/ident_general/email"}}

Store Name:

{{config path="general/store_information/name"}}

Store Code is trickier. This is not exposed in the config to my knowledge for use by the email templates. I suggest using a custom template file, and refer this way:

{{block type="core/template" template="custom/storecode.phtml"}}

storecode.phtml:

<?php

echo Mage::app()->getStore()->getCode();

Alternatively, and maybe less-desirable, are Custom Variables.

Custom Variables

System > Custom Variable > Add New Variable

enter image description here

To Implement a custom variable into a Transactional Email, do the following: In the Admin Panel, select System > Transactional Emails Click the row of predefined template to edit or click [Add New Template] button to create a new one. Create a new transactional email first if needed. In the Template Content field, select a location for your custom variable. Click [ Insert Variable ] and select the Custom Variable you would like to insert.

enter image description here

Source: http://www.magentocommerce.com/knowledge-base/entry/creating-custom-variables

6
  • 1
    Custom variables are constant vars for all stores, as I understand. The {{skin}} var is not a solution, as I want a general solution that inserts the name (or code) of the store in the logo name. So if store 1 is called abc-shoes, the logo name would be abc-shoes_email.png, and for store 2 with name xyz-shoes it should become xyz-shoes_email.png when using the same email template for the xyz-shoes store.
    – SPRBRN
    Commented May 14, 2013 at 13:34
  • Edited to reflect that.
    – philwinkle
    Commented May 14, 2013 at 13:34
  • My solution for store code may be applicable for logo if you append it to the image field - e.g. <img src="logo_{{storecodestuffhere}}.jpg"/>
    – philwinkle
    Commented May 14, 2013 at 13:35
  • Another angle for solution is that you can assign transactionals to specific stores. Set up a new transactional in System > Transactionals for each store and update the logo there if you don't want to mess with template files.
    – philwinkle
    Commented May 14, 2013 at 13:50
  • Thanks a lot! Sorry for the late reply. Storecode works, and that's super!
    – SPRBRN
    Commented Jun 26, 2013 at 9:07
1

To upload your email logo:

  1. From the Admin panel, select System > Configuration

  2. In the Configuration panel on the left, under Design, select Transactional Emails.

  3. Click the Browse button and select the Logo Image from your computer;

  4. In the Logo Image Alt field, type the alt text you want to use for the image;

  5. When complete, click the Save Config button.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.