Send Email Action

Description

A Send Email Action sends an email to recipients.

Java Class

The Action is implemented by the Java class de.ecm4u.faw.api.impl.SendEmailAction.

Parameters

There are four required parameters.

  • SendEmailAction.from: The content of the from email header.
  • SendEmailAction.to: The recipients, separated by comma.
  • SendEmailAction.subjectTemplate: The name of the textresource that contains the template for the email subject. The type of this textresource must be emailTemplate.
  • SendEmailAction.bodyTemplate: The name of the textresource that contains the template for the email body. The type of this textresource must be emailTemplate.

Any number of optional parameters using the prefix bodyTemplate can be used to provide parameters for the body template.

Example Parameters

args:
  SendEmailAction.from: Sender <sender@example.com>
  SendEmailAction.to: Recipient 1 <recipient1@example.com>, Recipient 2 <recipient2@example.com>, Recipient 3 <recipient3@example.com>
  SendEmailAction.subjectTemplate: test-email-subject.txt
  SendEmailAction.bodyTemplate: test-email-body.txt
  bodyTemplate.salutation: Hello!
  bodyTemplate.greeting: Regards

These parameters will send the email to three recipients. In the body template the two placeholders ${salutation} and ${greeting} will be replaced with Hello! and Regards.

Templates

Templates can be written to use Freemarker for a template file with the extension .ftl or the Apache StringSubstitutor for a template file with the extension .txt.