Show TOC

Background documentationSend Email Action

 

You use the Send Email action to notify a person of a particular situation in the system. It is then up to the person who has received the mail to decide whether specific measures have to be taken to cope with the situation or not. The situation itself may be critical or not, depending on what you think is useful for your business. Obviously, it is always a good idea to notify a person responsible if a critical situation has occurred. However, there may also be situations or activities that do not indicate a problem but simply occur infrequently and on an irregular basis. Here, an automatic notification sent to you by the system helps you to get rid of routine checks and lets you spend your time on more useful tasks.

Prerequisites

The SAPconnect component (BC-SRV-COM) has been set up for internet services. You must create an appropriate node in the SAPConnect administration and enter an RFC destination of the type TCP/IP connection with which you establish a connection to a mail server. For more information, see the documentation on SAPconnect.

Features

General

With the Send Email action, you can make the system send an email with a predefined text via the standard SMTP protocol. This is useful when your rule processing flow contains points where critical situations may arise that need human expertise. The same holds for workflow scenarios where different workflow agents are assigned and processing can only continue after a specific role owner has taken the necessary action.

Receiver

You can either enter a static email address or let the receiver be determined dynamically with the help of expressions. You can also combine both ways of addressing receivers in the same action. This enables you to make sure that a particular person is always notified (for example, the quality manager), plus the person who is currently in charge of reacting to the notification (for example, the responsible employee in the current shift of a three shift operation company).

You can enter any number of static email addresses into the Direct Email entry field, separated by semicolons. Note that you may enter a string of addresses that by far exceeds the visible length of the entry field.

If you choose to let the recipients be determined dynamically, make sure that you choose an expression, a constant, or a context data object of type text. The string returned by the chosen object must of course follow the same syntactic rules as in the static email address field. You can define up to four different expressions for receiver determination in one action.

Note Note

If you have to send different emails to a distribution list, you can model this use case by assigning a table data object as dynamic recipient that has previously been populated with the email addresses. To accomplish this, make sure that the table structure consists of only one text field to hold one address per entry. Populating the table data object can be done, for example, with the help of a decision table expression in multiple match mode.

End of the note.
Mail Body

In the Body field, you can, again, either enter a predefined static text, a text that is dynamically put together at runtime with the help of message variables, or a combination of both. You may define up to eight variables per Send Email action, each of which may be replaced at runtime by a constant, the result of an expression, or an elementary context data object.

Example

In a ruleset that you use to manage customer requests for an insurance contract, you have implemented a discrimination of incoming requests between standard requests and other requests that need special handling for a variety of possible reasons, such as:

  • Unusually high insurance amount

  • Requestor is located in a different country

  • Inconsistent request form data

All these reasons would have to be considered as an exception to the standard request handling and need human intervention. To accomplish this, you create an additional processing path in the ruleset where a Send Email action is triggered. In this action, you would enter a predefined text describing the issue and enrich this text with dynamic content such as the contract request ID or the requested insurance amount, both taken from the ruleset context. Also, you may use an expression to determine the employee in your company who is currently in charge of resolving issues of the type in question, and assign this employee as email receiver.