Task Email Notifications module
Edition |
Incubator (services) |
||
Issues |
|||
Git |
|||
Latest |
6.2
|
The Task Email Notifications module adds the ability to send emails to users which have a task waiting. This can be useful for publication requests. Users can receive email notifications from Magnolia about the task and its current state.
This module is at the INCUBATOR level.
|
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency>
<groupId>info.magnolia.task</groupId>
<artifactId>magnolia-task-email-notifications</artifactId>
<version>6.2</version>
</dependency>
Usage
The module provides an event listener that is specific to task nodes.
Configuration
The module provides an additional listener extending from RestrictToNodeTypeEventListener
with two additional required configurations:
- Class
-
info.magnolia.task.observation.commands.RestrictToTaskEventListener
Property | Description |
---|---|
|
required The value can be any of the statuses listed here. |
|
required The name of the task on which the listener should react. |
Other configuration options are listed in the Observation module. |
The module also provides a template for new tasks. It sends a simple html email with all the details about the task. It uses a model class to retrieve data from the task node.
Setup
The module depends on both the mail module and the observation module. Here you will find two new configurations bootstrapped into the system.
-
Setup
smtp
using the Mail module. -
Set the value of the from property:
/modules/mail/config/templatesConfiguration/publishTaskCreatedNotification@from
. -
Set the value of the mailTo property:
/modules/observation/config/listenerConfigurations/sendMailOnPublishTaskCreated/listener/params@mailTo
. -
Activate the observation:
/modules/observation/config/listenerConfigurations/sendMailOnPublishTaskCreated@active
. -
Test out the mechanism by publishing a page. Check the inbox for the mail.
Custom scripts
The module comes with a model class for retrieving task data and two example scripts. To create a customized script start with one of the scripts provided by module as a base.
Both scripts interact with info.magnolia.task.observation.model.TaskNodeModel by way of the Rendering context objects model. |
-
jsonPublishTaskCreatedNotification.ftl - retrieve all task data as a JSON object with one call to the model ((warning) added in 5.7.2)
-
publishTaskCreatedNotification.ftl - retrieve task data on a property-by-property basis