Magento 1

Email (& Static Block) Directives


Used to pull out any variables which are passed in to the template via the ‘bind’ parameter. Methods can also be called on passed in variables on the email objects:

{{var subscriber.getConfirmationLink()}}
$bind = array(
	'passedInVariable'  => array(
		'horse' => 'Moose’


Creates the block, and sets the parameters on them (or calls the methods). If type is not set as a parameter

{{block type='cms/block’ customVar='1’ methodToCall='test’}} 


{{protocol}} - current protocol http or https
{{protocol url=""}} domain URL with current protocol
{{protocol http="http://url" https="https://url"}


Puts a system config setting into the email

{{config path="path/to/config"}}


{{customvar code="custom_var_code"}}


This is used in Magento’s new email styling method. Styles from the CSS file specified are “Emogrified” and placed into style tags on the corresponding elements.

{{inlinecss file="path/to/file.css"}}


Loads the layout handle specified and sets all variables on each of the blocks in the layout handle. Methods can also be called on the blocks in the layout handle using this method, if they exist. “area” can also be set as a parameter but will default to the current area if not. Most likely this will be ‘frontend’

{{layout handle="my_custom_layout_handle_to_be_used" variable="test" method="moose"}}


Embeds the url to a skin asset, _secure can be used if required.

{{skin url="path/to/asset.ext" _secure="true"}}


Embeds a media URL, _secure can be used if required

{{media url="path/to/media/asset.ext" _secure="true"}}


Get the URL for the store. If the url doesn’t end in a suffix, then ‘URL’ can be used, otherwise, direct_url should be used instead. Parameters can also be passed into the url using the syntax _query_paramName=”paramValue”

{{store url="contacts"}} //
{{store direct_url="html_file.html"}} //
{{store direct_url="goosey.html" _query_param="horseparam"}} // http://dave.magento-test-2.iweb/goosey.html?param=horseparam


Allows the contents of the depends to be omitted if the clause doesn’t hold true.

{{depend order.getIsNotVirtual()}}
<!-- Statemement -->


Allows the contents of the if to be omitted if the clause doesn’t hold true. Like depends, but allows the use of an else clause

{{if order.getIsNotVirtual()}}
<!-- Statemement One -->
<!-- Statemement Two -->


Allows templates to be inserted via a config path. The config paths in the example are from System > Config > Design > Transactional Emails

{{template config_path="design/email/header"}}
{{template config_path="design/email/footer"}}