Email Notification Action Plugin



This action plugins sends email as part of the execution of a workflow.

Saved Parameters Description

  • Name: The name used to identify a saved EmailNotification configured instance.
  • Comments: Some comments about this saved EmailNotification configured instance.
  • Mailer: The smtp server to use for sending email. Available smtp servers can be configured in the EngineMailer Configurations section.
  • Message Core parameters: Provides the specification of how to construct the message core parameters at run-time. See Operating Instructions
  • HTML Message Template: The template to use for HTML message body. This text will be displayed by HTML capable email clients.

Inputs Description

The list of inputs depends on the configuration of the EmailNotification action template.

More precisely they depend on the specification of the Message Core parameters and HTML Message Template. They both support custom variable specification using a <%= runtime_variable_name %> syntax.

If the default Message Core parameters is used, the following inputs are available:

  • To: The destination address.
  • Subject: The text to use as email subject.
  • Message: The text to use as email text body. If the HTML Message Template is present, this text will be used for not HTML capable email clients.

These additional inputs are optional and always available:

  • MessageDefinition_Override: The text to use as email body. This will overwrite both the Message Core parameters and the HTML Message template settings.
  • attachment_list: The list of (local) files to join to the email as attachments.

Outputs Description

  • FullMessage: The entire email in its XML form. The XML schema used is the same as in Message Core parameters.

Supported Actions

None

Dependencies

None

Operating Instructions

How to define the message core parameters

A message template specifies how the different part of the email will be built: such a template has to be specified in the Message core parameters text box.

In its simplest form a message template includes Destinations,Subject and Message fields.

In order to specify how the message has to be built at runtime this plugin uses a simple XML structure to define the different fields:
<MessageDefinition>
    <Destinations><To>orchestrator@asperasoft.com</To></Destinations>
    <Subject>New notification%lt;/Subject>
    <Message>You have received a new notification.</Message>
</MessageDefinition>
  • Destinations specifies the list of recipients the email is targeted to. Each recipient is specified using the To element.
  • Subject specifies the email subject
  • Message specifies the email text message.

Any of the fields can contain variables that are resolved real time by the orchestrator engine, using the notation <%= runtime_variable_name %>. Such a variable will be available as input for the step using this template instance. The message element is only visible in the final email if there is no HTML Message Template specified or the email client does not support HTML visualization.

Example: destination resolved at run time

The destination of an email can be set at run time by specifing the following template:
<MessageDefinition>
    <Destinations><To> <%= user_address %> </To></Destinations>      
    <Subject>New notification%lt;/Subject>
    <Message>You have received a new notification.</Message>
</MessageDefinition>

A step using this template has the user_address variable in the list of inputs that can be mapped.

In a real workflow a previous step or a parameter has to provide the destination address.

Example: include file information in the message body

Usually the message body is defined using the HTML Message template field, but if using HTML is not possible or not suitable, the message body can be specified in the template and it can contain run time resolved variables:
<MessageDefinition>
    <Destinations><To> user@mycompany.com </To></Destinations>
    <Subject>New notification%lt;/Subject>        
    <Message>You have received a new file: <%= file_name %> </Message>
</MessageDefinition>

A step using this template has the file_name variable in the list of inputs that can be mapped.

Default template

If the Message core parameters box is left empty, a default template is used. The default template is defined as follows:
<MessageDefinition>
    <Destinations><To> <%= To %> </To></Destinations>
    <Subject> <%= Subject %> %lt;/Subject>
    <Message> <%= Message %> </Message>
</MessageDefinition>

When using the default template all fields are inputs and only a single destination address is accepted.

How to define the HTML Message Template

The email body can be specified using standard HTML markups using the HTML Message Template text box.

As in the message template, if some values to include in the body are only available at run time, the <%= runtime_variable_name %> notation can be used.

The defined variables will then be available in the list of inputs for the steps using the template.

How to define the HTML Message Template

The email body can be specified using standard HTML markups using the HTML Message Template text box.

As in the message template, if some values to include in the body are only available at run time, the <%= runtime_variable_name %> notation can be used.

The defined variables will then be available in the list of inputs for the steps using the template.

How to attach files to an email

It is possible to attach one or more files to the generated email by simply provide their absolute paths as a comma separated list to the step in the attachment_list variable.

The files need to be locally accessible by the Orchestrator machine.