Email Action
With an e-mail action, you can automatically send any content to selected recipients. Adding recipients is just as dynamic as the design of the mail content, from individual pages in Intrexx applications, to pages generated with Groovy or Velocity, to pure text mails.
To use this function, the e-mail service must be set up in the "Tools" module. To send emails with links to portal pages via processes, the "Base URL" field in the portal properties must contain the base URL of the portal (e.g. https://exampleportal.com/).
The e-mail action can be found in processes in the "Elements" area. From there, it can be dragged and dropped to the desired position in the process chain and then configured. General information on creating process elements can be found here.
Once you have created the email action on the workspace, open the Properties dialog by double-clicking on the element.
General
You will also find this dialog for other process elements.
The title and description can be edited here.
Multilingualism
Opens a dialog in which the title can be entered in multiple languages. Further information can be found here.
Content
Subject
Static subject, language independent
Here, you can specify any static text that will be used in the subject line of every email.
Static subject, language dependent
Here, you can specify a language-dependent static text that will be used in the subject line of every email. The language which is used for the subject corresponds to the language used for the email's body. The language is usually determined from the context.
Further information can be found in the documentation for the Java class " de.uplanet.lucy.server.ContextLanguage".
The language can be overwritten with the "language" expert attribute. Either a language code, e.g. ""de"" or ""en"", or a variable from the processing context, which contains a language code, can be used as the value.
Multilingualism
Opens a dialog in which a title can be entered in the various portal languages.
System value
Displays the selected system value.
Edit system value
Opens a dialog in which the system value can be edited.
Data Field
The subject can also be generated dynamically from the value in a data field. Select the required data field from the drop-down list.
Content
Page from application
Select the view page you want to send from this list. The values of the current record will automatically be used. Please note that all recipients of the email must have read permissions to the page. If the page right is not given, the page will not be sent. Information on the subject of rights can be found here.
Edit parameter
Opens a dialog in which the parameters required for the page can be edited.
Generate message from static text
This option gives you the ability to compose a fixed text for the email.
Edit text
Opens an editor in which the text can be edited.
Generate message from Velocity code
With this option, Velocity script will be used to provide the text for the email.
Edit velocity code
Opens the Velocity Editor, in which messages can be generated from the context.
Options
HTML
With this option, the e-mail is sent in HTML. Buttons can then be added to the page, which link to specific pages of the application.
Text
With this option, the values of the view and input fields are output in text format and separated by a tab.
SMS
If this option is selected, all line breaks are removed. the complete text is placed in the subject, and the message is sent by SMS, provided that a facility to send SMS messages has been setup by your telecommunications provider.
Message header
Indicates whether the message header has been configured or not.
Edit message headers
Opens a dialog in which the header information for the e-mail can be configured.
Message headers
Select the desired header property by clicking in the corresponding cell. Predefined properties can be selected from the drop-down list that will appear.
Once a property has been selected, the values are filtered accordingly so that you can easily select the values in question.
In addition to the predefined properties, you can also create your own properties. To do this, click in the corresponding column and enter the property and value directly.
Click on "Add message header" to create a new line,
"Remove message header" to remove the selected line.
The value "${sender}" can be used for some predefined properties. In this case, the sender of the email will be entered dynamically.
Confirm the settings by clicking on "OK". If an e-mail is then sent, the properties are found in the e-mail client and in the detailed header information.
mailheader.properties
Both the names of the predefined properties and the values that can be selected here are recorded in the "mailheader.properties" file. This file can be found in the installation directory "client/cfg". This can be modified and added to.
Dynamic header value
Instead of static values, dynamic values can also be implemented here, for example from the shared state of the current processing context. The following prefixes are supported:
urn:sharedState:
urn:request:
urn:session:
urn:user:
urn:systemDataGroup:
In a specific example within a Groovy action or filter condition,
def strValue = g_record["5A1D3EC0DB71BE6B6BC4F83BECCE85ACD22F82E6"].value
g_sharedState.customValue = strValue
a SharedState variable with the name "customValue" can be defined, which is filled with a specific value, e.g. the value from a data field. In a follow-on email action, the value set in the shared state can be read out again.
To do this, use the prefix "urn:sharedState:" mentioned above followed by the name of the "customValue" variable defined in the Groovy action. When using an entry from a system data group, the value is made up as follows:
urn:systemDataGroup:APPLICATIONS_GUID:DATAFIELD_GUID
Enter the GUID of the application in which the system data group was created and the GUID of the data field from the system data group whose value is to be used, e.g:
urn:systemDataGroup:142EB475CEF4B719CE2A8430AFEEAF986BFCB229:8647E7B2E26E98FCBAF32DE2C867B2EF756707DA
Click on "OK" to save the settings and close the dialog again.
Click "Next".
Sender
Send from
Current user
With this setting, the e-mail address of the current user is queried and used as the sender.
Person responsible for the application
The email address of the user, who has most recently saved the application to which the process belongs, will be used.
Static address
With this option, a static email address of your choice can be entered.
Address from data field
This option allows a data field to be used as a dynamic sender list.
Default sender from email service configuration
The default sender is used here.
System value
With this option, system values can be used as the source of the email address.
Edit system value
Opens a dialog in which the system value can be edited.
Options
Use alternative sender address
This option can be used to specify an address which will be used when an email address is not defined or when errors occur.
Click "Next".
Recipient, Recipient CC, Recipient BCC
Static distribution list
A fixed list of email addresses can be entered here as a distribution list. Each address must be separated with a semicolon.
Dynamic distribution list
Application, Data group, Data field
Select the source of the email addresses here. Text data fields containing e-mail addresses separated by semicolons can also be used. Other separators are not permitted.
Edit filter
Opens a dialog in which the address list can be restricted in advance using filter criteria.
Type
Select one of the following four types here:
-
Semicolon separated list
-
Free text
-
Values from multiple selection (selectable if a text data field is selected as the source for the e-mail addresses)
-
Distributor (selectable if a string data field is selected as the source for the e-mail addresses)
Address from data field
In contrast to the dynamic distribution list, the value from the current data set will be used. This setting is available from an edit or view page where a data record is opened or created.
Data Field
Select the field that contains the email addresses of the intended recipients.
Type
Select one of the following four types here:
-
Semicolon separated list
-
Free text
-
Values from multiple selection (selectable if a text data field is selected as the source for the e-mail addresses)
-
Distributor (selectable if a string data field is selected as the source for the e-mail addresses)
Superior / Deputy of current user
This setting is used to query the e-mail address of the current user's manager or deputy.
System value
With this option, system values can be used as the source of the email addresses.
Edit system value
Opens a dialog in which the system value can be edited.
Options
One email for each recipient
With this setting, an individual email will be generated for each recipient. This option is not available on the ""Recipient CC/BCC"" tab. If the setting is not set, all recipients are entered in the e-mail separated by a semicolon.
If you confirm this dialog with "OK", all settings are saved and the dialog is closed again. Configuration of the email action is now complete.
Exception handling
When the email action is created and configured, you can open the Properties dialog again by double-clicking the item on the workspace and set the procedure here in the case that no recipients could be determined.
Cancel transaction (default)
Causes the entire process to be aborted if no e-mail addresses are available. If, for example, a dynamic distribution list with the type "Free text" has been set as the source for the recipients, but the underlying data field does not contain any corresponding data in the current data record, the entire process is canceled with this setting.
Continue transaction
The error is ignored. An email is not sent. The process will continue with the next action.
NULL values
Under certain circumstances, a process does not run without errors despite the "Continue transaction" option being set.
If, for example, the recipient of the email is determined in the process using a system value from a system data group, the process may be aborted if there are zero values - e.g. if the recipient data field in the system data group is empty.
Values from the system data group are recorded as configuration parameters for applications. In this sense, the absence of a special value is treated as an error. If this is not desired, a Groovy condition or a Groovy action that transfers the list of recipients to the shared state can be added upstream in the process, for example. This kind of list can be empty but cannot contain null values.
The behavior when handling null values is the same for all context variables with the type
-
URN_REQUEST_PREFIX
-
URN_SESSION_PREFIX
-
URN_SHARED_STATE_PREFIX
-
URN_USER_PREFIX
-
URN_WORKFLOW_USER_PREFIX
-
URN_SYSTEM_DATA_GROUP_PREFIX
The property to continue the transaction refers to the list of determined recipient addresses. The recipient addresses in this list are gathered from the following sources:
-
Staticly entered recipients
-
Recipients from the request
-
Recipients from the session
-
Recipients from the sharedState
-
Recipients from a user field
-
Recipients from the system data group
-
Recipients from a data field of the current data record
-
Recipients from a table
-
Superiors of the current user
-
Deputies of the current user
Once this list of recipients has been collated, Intrexx checks whether it is empty. The property is now used to control how the case that this list is empty is handled:
-
as an error than leads to an exception or
-
as a warning in the log - an email will not be sent, however.
More information
IMAP event source - Monitor folders of an IMAP mail server