Email connector

The email connector is used to send emails using the SMTP protocol as part of a process instance. The email connector is graphically represented by an envelope under the OOTB Connectors menu whilst modeling a process.

The implementation value of the email connector in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_1che7zm" implementation="emailConnector.SEND" />

Actions

The email connector contains an action called SEND that sends an email using an external SMTP host.

Input parameters

The following are the parameters that can be passed to the email connector as input parameters using the SEND action:

ParameterDescriptionTypeRequired?
toAn email address or list of addressesStringYes
fromAn email addressStringYes
ccAn email address or list of email addressesStringNo
bccAn email address or array of addressesStringNo
subjectA plain text subjectStringNo
textA plain text email bodyStringNo
htmlAn HTML email bodyStringNo
charsetDefine the charset of the emailStringNo
nodeIdThe node ID of the file to attach to the emailStringNo
uriThe URI of the file to attach to the emailStringNo
filesA file uploaded in a process and set as a process variable or uploaded as part of a form or another connector to attach to the emailFileNo

Output parameters

The following is the parameter that is returned to the process by the email connector as an output parameter using the SEND action:

Note: The execution of the email connector is always successful. Any errors will be returned in the email.error parameter. The parameter will be null if there were no errors.

ParameterDescriptionType
email.errorA list of errors if any are caught by the connectorString

Events

The email connector contains an event called EMAIL_RECEIVED that can be used by a trigger to configure an action when an email subject line meets a specific pattern.

Input parameters

ParameterDescriptionExampleRequired?
patternA regular expression that selects which emails are published as events. Java catching group syntax can be used to create groups from the pattern as variablesOrder Number (?<orderNumber>.+)Yes
echoThe message sent to the original sender if a message is matchedYour reference number is ${orderNumber}No
echoErrorThe message sent to the user if an error occurs publishing the eventThere was a problem publishing that event.No

Note: Any groups created in a pattern can be referenced in echo and echoError using the syntax ${groupName}.

Output parameters

ParameterDescriptionTypeRequired?
matchGroupsAny matching groups found using the regular expression in patternJSONNo
emailSubjectThe subject of the matched emailStringNo
emailToThe recipient of the matched emailStringNo
emailFromThe sender of the matched emailStringNo
emailBodyThe message body of the matched emailStringNo

Note: Groups found in matchGroups can be used to map to process variables in a trigger by referencing the variable in a JSON field, for example using ${matchGroups.orderNumber}

Configuration parameters

Values for configuration parameters that are specific to a connector instance can be set in the modeling application or during application deployment.

The email connector uses the org.springframework.mail package for managing communication to the email server. This allows spring.mail.properties* to be set to configure the desired email server.

The following are the configuration parameters that need to be set for the email connector:

ParameterDescription
EMAIL_HOSTThe host address of the SMTP server
EMAIL_PORTThe port the SMTP server is running on
EMAIL_USERNAMEThe username the connector will use to contact the SMTP server
EMAIL_PASSWORDThe password of the user the connector will use to contact the SMTP server
EMAIL_SMTP_AUTHThis is a boolean value that sets whether the connection to the SMTP server requires authentication
EMAIL_SMTP_STARTTLSThis is a boolean value that sets whether the connection uses TLS

© 2023 Alfresco Software, Inc. All Rights Reserved.