Have subscribed to page events, for example modification or replication. The Notification Inbox section describes how to subscribe to such events.

Have subscribed to forum events.

Have to perform a step in a workflow. The Participant Step section describes how to trigger email notification in a workflow.

Pre-requisites:

The user(s) needs to have a valid email address defined in his profile.

The Day CQ Mail Service needs to be properly configured.

When a user is notified, he receives an email in the language that is defined in his profile. Each language has its own template that can be customized. New email templates can be added for new languages.

Note:

When working with AEM there are several methods of managing the configuration settings for such services; see Configuring OSGi for more details and the recommended practices.

Configuring the Mail Service

For AEM to be able to send emails, the Day CQ Mail Service needs to be properly configured. You can view the configuration in the Web console. When working with AEM there are several methods of managing the configuration settings for such services; see Configuring OSGi for more details and the recommended practices.

The following constraints apply:

The SMTP server port must be 25 or higher.

The SMTP server host name must not be blank.

The "From" address must not be blank.

To help you debug an issue with the Day CQ Mail Service, you can watch the logs of the service:

com.day.cq.mailer.DefaultMailService

The configuration looks as follows in the Web console:

Configuring the Email Notification Channel

When you subscribe to either page or forum events notifications, the from-email address is set to no-reply@acme.com per default. You can change this value by configuring the Notification Email Channel service in the Web Console.

To configure the from-email address, add a sling:OsgiConfig node to the repository. Use the following procedure to add the node directly using CRXDE Lite:

Replace the value of the email.from attribute (name@server.com) with your email address.

Save the file.

Configuring the Workflow Email Notification Service

When you receive workflow email notifications, both the from-email address and the host URL prefix are set to default values. You can change these values by configuring the Day CQ Workflow Email Notification Service in the Web Console. If you do so, it is recommended to persist the change in the repository.

Customizing Email Templates for Workflow Notification

To customize the English email template for workflow event notification:

In CRXDE, open the file:/etc/workflow/notification/email/default/en.txt

Modify the file to your needs.

Save the changes.

The template needs to have the following format:

subject=<text_1>
header=<text_2>
message=<text_3>
footer=<text_4>

Note:

Where <text_x> can be a mix of static text and dynamic string variables. Each line of an <text_x> item needs to be ended with a backslash (\), except for the last instance, when the absence of the backslash indicates the end of the <text_x> string variable.

The method ${payload.path.open} reveals the path to the payload of the workitem. For example, for a page in Sites then then payload.path.open would be similar to /bin/wcmcommand?cmd=open&path=….; this is without the server name, which is why the template prepends this with ${host.prefix}.

The following variables can be used within the email template:

${event.EventType}, type of the event

${event.TimeStamp}, date and time of the event

${event.User}, the user who triggered the event

${initiator.home}, the initiator node path

${initiator.name}, the initiator name

${initiator.email}, email address of the initiator

${item.id}, the id of the work item

${item.node.id}, id of the node in the workflow model associated with this workitem