Sending Outgoing E-mail

Many applications need to send e-mails – to their customers, internal staff etc. As described in the Defining Intelligent Business Objects section to send e-mails you need to define the party you are sending e-mails to as an intelligent business object and define the e-mail communication channel for this object – see Setting Properties of E-mail Channel.

The settings for sending emails can be defined if you double click on the business space version and select the “Outgoing Emails” property. The following properties should be specified:

The DNS name of your e-mail server that will send outgoing e-mails to the intelligent business object.

The e-mail address that your e-mails to the business object will have as the “from” address. Note that the “from address” must be recognized by your email server, so it must be registered on this server.

If your outgoing e-mail server requires that you log in select the “Login Required” option, press the Details button and enter login credentials. Otherwise select the “No Login Required” option.

OAuth Support

Some email providers require OAuth authentication, in which case you have to provide the details by ticking the “OAuth support” checkbox and providing OAuth settings. This is very much like providing OAuth settings for REST communication see Setting Properties of the REST Channel

E-mail Notification

The actual e-mail sent to the external party represented by the intelligent business object must be a notification – see Adding/Editing Notifications. It is up to you how you define the attributes of this notification and the rules that will be executed when this notification is created. However, you have to make sure that you define the following attributes in the notification representing an outgoing e-mail:

  1. Subject – this attribute must be of the Plain Text type and must contain the subject of the e-mail.
  2. Message – this attribute must be of the Plain Text type and must contain the body of the e-mail.
  3. HTMLMessage – this attribute must be of the Document type. If value of this attribute is defined and contains valid HTML document, the email will be sent in HTML format rather than in a standard text format.
  4. CC and BCC - these attributes represent copy and blind copy lists respectively. The email addresses in the list must be separated by a semi-colon. You can initialize the list from a list of references by using the LIST_LINE function.

You can also optionally add the EHeaders attribute to this notification if you want to add special headers to your email. The value of this attribute should be in the following format:

Header1#Header2#Header3... 

where each header represents name and value in the standard header format:

Name: value 

The Configuration Tool provides a convenience feature that creates the skeleton of the outgoing e-mail notification with all the required attributes automatically. You can use this feature to add the notification and then change it as you wish. To create the outgoing e-mail notification:

  1. Right click on the “Notifications” node of the business space version in the Elements Tree to bring up the pop-up menu.
  2. Select the “Add Outgoing E-mail Notification” command from the pop-up menu. The new notification with the name OutgoingEmail will appear in the Elements Tree.

Using the steps described above you can add as many outgoing e-mail notifications as you like. You can then change their names, add other attributes and/or attach creation rules – see Adding/Editing Rules.

An email account that will be used when sending a notification is determined either from the SEND action itself or from the properties of the Email channel defined for the intelligent object if the account is not specified in the SEND action. An email account contains properties such as email server, port and authentication details.

If you want to use an email account directly in the SEND action you need to do the following:

  1. Create the definition of the email account object in the Configuration Tool by selecting the Business Objects node in the tree and then choosing “Add Outgoing Email Account” menu command. This command will create the object with the required predefined attributes
  2. Define the SEND action with the USING syntax. The instance of the EmailAccount object is taken from the Context of the rule – exactly one instance of this object must be present in the Context
  3. At runtime the user needs to populate the values of the EmailAccount object before invoking a process that uses the account in the SEND action.
  • Last modified: 2024/02/01 05:56