Skip to the content
Documentation

Customizing the E-mails

No ratings yet

Notification mails are rendered from templates, one per handler, which you can override in your design like any other template.

The templates

  • a change below a followed item: notification/handler/ezsubtree/view/plain.tpl
  • the digest: notification/handler/ezgeneraldigest/view/plain.tpl, which includes notification/handler/<handler>/view/digest_plain.tpl per handler (for followed items ezsubtree/view/digest_plain.tpl, with digest_element_plain.tpl per item)
  • collaboration items: notification/handler/ezcollaboration/view/plain.tpl, and per type, for example ezcollaboration/view/ezapprove/approve.tpl and author.tpl

The originals are in design/standard/templates/. The text of the template is the body of the mail. A template sets the headers with set-block:

{* a simplified version of the shipped ezsubtree/view/plain.tpl *}
{set-block scope=root variable=subject}{$object.content_class.name} "{$object.name}" was published [{ezini( 'SiteSettings', 'SiteURL' )}]{/set-block}
{set-block scope=root variable=from}{concat( $object.owner.name, ' <', $sender, '>' )}{/set-block}
{* also possible: message_id, reply_to, references, content_type *}
{$object.name|wash} was published or changed:
{concat( 'https://', ezsys( 'hostname' ), $object.main_node.url_alias|ezurl( 'no' ) )}

$sender is the sender address, notification.ini [MailSettings] EmailSender (or site.ini [MailSettings] AdminEmail). Keep the set-block lines you need when you copy a template.

Overriding

Put a changed copy at the same path in your design's templates/ folder (for example design/mysite/templates/notification/handler/ezsubtree/view/plain.tpl), or add an override rule in override.ini. Clear the template caches afterwards.

HTML mail

With notification.ini [MailSettings] HTMLLayout=enabled (the default), a text template is sent as text and as HTML in the mail layout design:mail/layout.tpl. A template that sets content_type is sent as it says.

Related pages

Contributors

Comments (1 historical)

Written by readers of the earlier documentation sites, kept as they were.

Comments

Add a comment

Comments are read by a moderator before they appear.