71 lines
2.3 KiB
Plaintext
71 lines
2.3 KiB
Plaintext
About mail layout and templates
|
|
-------------------------------
|
|
|
|
Layouts
|
|
-------
|
|
|
|
Mail layouts are used to provide a layout to all or some of the e-mails sent by
|
|
the Thelia core or the modules.
|
|
|
|
The layouts should have the 'tpl' extension, and should use {$message_body} as the
|
|
placeholder of the final message content.
|
|
|
|
For example, a minimal layout is :
|
|
|
|
{$message_body}
|
|
|
|
There are no specific limitations in the content of the layout. For exemple, you
|
|
can forecast inheritance, using a block :
|
|
|
|
{block name='message-body'}{$message_body nofilter}{/block}
|
|
|
|
(In fact, this is the content of the default HTML layout, default-html-layout.tpl)
|
|
|
|
This way, you can extends the layout in message templates :
|
|
|
|
{block name='message-body'}
|
|
|
|
Here is the template content
|
|
|
|
{/block}
|
|
|
|
|
|
Templates
|
|
---------
|
|
|
|
A Template contains the body of a specific message. It can be used It may extends a layout, but
|
|
in this case, you SHOULD NOT select this layout as the message layout in the back office.
|
|
|
|
HTML templates SHOULD have the 'html' extension to be displayed in the "Name of
|
|
the HTML template file" menu in the back-office.
|
|
|
|
TEXT templates SHOULD have the 'text' extension to be displayed in the "Name of
|
|
the text template file" menu in the back-office.
|
|
|
|
|
|
What you can do with this stuff ?
|
|
---------------------------------
|
|
|
|
For a specific message, you can :
|
|
|
|
Not use templates or layouts, and rely on HTML and TEXT entered in the back-
|
|
office.
|
|
|
|
Use only layouts, to define a common look and feel to your mails. These layouts
|
|
are be populated (through {$message_body}) with HTML or TEXT entered in the back-
|
|
office.
|
|
|
|
Use only templates, without layouts, to define message content. In this case,
|
|
HTML or TEXT entered in the back-office is ignored.
|
|
|
|
Use layouts and templates, without inheritance. This way, layouts are populated
|
|
(through {$message_body}) with HTML or TEXT found in the message templates.
|
|
HTML or TEXT entered in the back-office is ignored.
|
|
|
|
Use templates which inherit from a layout. In the layout, {$message_body}
|
|
(if present) is then ignored, and the classic Smarty bock-based inheritance
|
|
is used.
|
|
Be sure in this case to not define an extended layout as ther message layout,
|
|
or unexpected results may be generated (probably repeated layout content)
|
|
|
|
Enjoy. |