Page tree
Skip to end of metadata
Go to start of metadata

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.  

Installation

Maven is the easiest way to install the module. Add the following dependency to your bundle:

<dependency>
  <groupId>info.magnolia.task</groupId>
  <artifactId>magnolia-task-email-notifications</artifactId>
  <version>${taskEmailNotificationsVersion}</version>
</dependency>

Versions

6.2Magnolia 6.2
5.7.2Magnolia 6.1
5.7.2Magnolia 5.7

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

status

required

The value can be any of the statuses listed here.

taskName

required

The name of the task the listener should react on.

Other configuration options are listed here: 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.

  1. Setup smtp using the Mail Tools app.
  2. Set the value of the from property: /modules/mail/config/templatesConfiguration/publishTaskCreatedNotification@from
  3. Set the value of the mailTo property: /modules/observation/config/listenerConfigurations/sendMailOnPublishTaskCreated/listener/params@mailTo
  4. Activate the observation: /modules/observation/config/listenerConfigurations/sendMailOnPublishTaskCreated@active
  5. 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 TaskNodeModel by way of the model rendering context object.

Warnings

  • This module is at INCUBATOR level.
  • The property nodeType on the listener configuration is overridden to use mgnl:task. It cannot be set to anything else.
  • This module is independent from workflow or the publication command chain. It reacts to changes in the task workspace only.
  • Email usernames containing dots does not work. See  MGNLMAIL-105 - Getting issue details... STATUS .
  • Correct configuration for sending mail through Gmail is unclear. See  MGNLMAIL-104 - Getting issue details... STATUS .

Changelog

  • Version 6.2
  • Version 5.7.2
  • Version 5.7.1
  • Version 5.7 - Initial release of the incubator version of the module.