| Both sides previous revision Previous revision Next revision | Previous revision |
| docs:2500_config_apps:2600_emails:0200_outgoing_email [2026/07/08 08:39] – aware_admin | docs:2500_config_apps:2600_emails:0200_outgoing_email [2026/07/09 05:39] (current) – aware_admin |
|---|
| {{tag>Index Email Outgoing Process Intelligent_Business_Object}} | {{tag>Index Email Outgoing Process Intelligent_Business_Object}} |
| [<10>] | [<10>] |
| ====== Sending Outgoing E-mail ====== | ====== Sending Outgoing E-mails ====== |
| |
| Many applications need to send e-mails – to their customers, internal staff etc. As described in the [[docs:2500_config_apps:0500_add_edit_objects:0600_intelligent_bo|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 [[docs:2500_config_apps:0500_add_edit_objects:0600_intelligent_bo:00050_setting_up_email|Setting Properties of E-mail Channel]]. | To be able to send e-mails in **AwareIM** you need to do the following: |
| | - Define "transport" for sending e-mails |
| | - Define a notification representing the e-mail you want to send |
| | - Define a ''[[a_f:a:send|SEND]]'' action of the Rule Language to send the e-mail to either an intelligent business object or a particular email address |
| |
| === E-mail Notification === | ===== Defining Email Transport ===== |
| | First of all, you need to define whether you will be using a standard SMTP-based email transport or Microsoft Graph REST-ful service. |
| |
| The actual e-mail sent to the external party represented by the intelligent business object must be a notification – see [[docs:2500_config_apps:1200_add_edit_notifications|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: | ==== Defining SMTP Transport ==== |
| | When defining SMTP transport you can specify global SMTP settings that will be used to send any email in your application. To define such settings double click on the business space version and select the "Outgoing Emails" property. The "Outgoing Emails" dialog will be displayed. Here you can specify whether SMTP settings will be stored in the special attributes of the SystemSettings object(these attributes are always available) or whether they will be specified directly in the Configuration Tool. The former is useful when these values can change. For both options the set of values to specify is the same and includes the following: |
| | |
| | <callout type="primary" icon="true"> |
| | Note: You need to pick a particular email provider like gmail, hotmail etc and find out actual SMTP values that these providers require |
| | </callout> |
| | |
| | === Outgoing Email Host === |
| | The DNS name of the SMTP server that will send e-mails.\\ |
| | \\ |
| | === Outgoing E-mail Port === |
| | The port that the SMTP server is listening on for e-mail requests.\\ |
| | \\ |
| | === "From" address === |
| | The e-mail address that your e-mails 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.\\ |
| | \\ |
| | === Login details === |
| | If your outgoing e-mail provider requires that you log in using standard user name and password combination, fill in "User Name" and "Password" fields.\\ |
| | \\ |
| | === OAuth Support === |
| | Some email providers require OAuth authentication, in which case you have to provide details by ticking the "OAuth support" checkbox. When using the SystemSettings object, tick the "Add attributes for OAuth support to the SyetemSettings object. This will add OAuth-specific attributes to this object. |
| | Defining OAuth settings is very similar to providing OAuth settings for REST communication see [[docs:2500_config_apps/0500_add_edit_objects/0600_intelligent_bo/0400_setting_rest_channel_props]] |
| | \\ |
| | === SSL Support === |
| | Whether the SMTP server supports the SSL protocol.\\ |
| | \\ |
| | === TLS Support === |
| | Whether the SMTP server supports the TLS protocol.\\ |
| | |
| | ==== Using Different SMTP Accounts When Sending E-mails ==== |
| | Sometimes it may be necessary to use different SMTP settings for different users. This can be achieved by defining a special business object that represents an SMTP acount. You will need to do the following:\\ |
| | \\ |
| | - Create a definition of the e-mail 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 predefined attributes that cover all SMTP settings described above. |
| | - Define the ''[[a_f:a:send|SEND]]'' action with the ''USING'' syntax. When using this syntax The instance of the ''OutgoingEmailAccount'' object will be taken from the Context of the rule(exactly one instance of this object must be present in the Context) and the values in this instance will be used to send the actual e-mail. |
| | - At runtime this instance of the ''OutgoingEmailAccount'' object needs to be created before invoking a process that uses this account in the ''SEND'' action. |
| | |
| | ==== Sending Emails Using Microsoft Graph ==== |
| | Using Microsoft Graph for sending emails does not mean that you have to replace SEND actions with REST service calls. The framework for email handling remains the same - whether you use SMPT or MS Graph. To send emails using Microsoft Graph you need to obtain your client id and secret from Microsoft, as well as tenant id and sender info. For details go to [[https://learn.microsoft.com/en-us/graph/api/user-sendmail]]. You then need to tick the "Emails will be sent using Microsoft Graph checkbox and click on the Settings link next to the checkbox. Then you need to enter values obtained from Microsoft. |
| | |
| | ==== E-mail Notification ==== |
| | |
| | The actual e-mail sent to an external party must be a notification – see [[docs:2500_config_apps:1200_add_edit_notifications|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: |
| |
| - ''Subject'' – this attribute must be of the Plain Text type and must contain the subject of the e-mail. | - ''Subject'' – this attribute must be of the Plain Text type and must contain the subject of the e-mail. |
| 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 [[docs:2500_config_apps:0800_add_edit_rules|Adding/Editing Rules]]. | 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 [[docs:2500_config_apps:0800_add_edit_rules|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 ''[[a_f:a:send|SEND]]'' action. An email account contains properties such as email server, port and authentication details. | <callout type="primary" icon="true"> |
| | Note that if you want to send an e-mail with attachments, you can define an attribute of the Document type in the e-mail notification. At run time you should populate this attribute with some document, **AwareIM will automatically use this document as an e-mail attachment. |
| | </callout> |
| |
| If you want to use an email account directly in the ''[[a_f:a:send|SEND]]'' action you need to do the following: | ==== SEND Action ==== |
| | This action of the Rule Language sends the notification to either an intelligent business object or to a specified e-mail address, optionally using a particular e-mail account SMTP settings. Here are some examples: |
| | <code>SEND SignupEmail TO Customer</code> |
| | This action will create an instance of the SignupEmail notification and send it to a Customer(s) in Context using global SMTP settings. The Customer object must have Email Communication channel defined. If there are multiple instances of the Customer object in Context, the e-mail will be sent to all of them. |
| | <code>CREATE SignupEMail WITH SignupEmail.BCC = '[email protected]' |
| | SEND SignupEmail USING OutgoingEmailAccount</code> |
| | This action will send an e-mail to [email protected] using an e-mail account in Context |
| |
| - 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 | |
| - Define the ''[[a_f:a:send|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 | |
| - 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. | |
| |
| ==== SMTP Settings ==== | |
| The settings for sending emails can be defined if you double click on the business space version and select the "Outgoing Emails" property. The "Outgoing Emails" dialog will be displayed. First of all, the configurator needs to specify whether outgoing email will be sent via standard SMTP protocol or by using a special Microsoft service called Microsoft Graph. This is a REST-ful service that does not use SMTP at all. For the standard SMTP email there is an option of using values specified in the System Settings object or whether to specify the settings directly in the Configuration Tool. The former is useful when these values can change. For both options the set of values to specify is the same. The following properties should be specified: | |
| |
| === Outgoing mail host === | |
| |
| The DNS name of your e-mail server that will send outgoing e-mails to the intelligent business object. | |
| |
| === "From" address === | |
| |
| 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. | |
| |
| === Login details === | |
| |
| 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 [[docs:2500_config_apps/0500_add_edit_objects/0600_intelligent_bo/0400_setting_rest_channel_props]] | |
| |
| ==== Sending Emails Using Microsoft Graph ==== | |
| Note that to use Microsoft Graph for sending emails does not mean that you have to replace SEND actions with REST service calls. The framework for email handling remains the same - whether you use SMPT or MS Graph. To send emails using Microsoft Graph you need to obtain your client id and secret from Microsoft, as well as tenant id and sender info. For details go to [[https://learn.microsoft.com/en-us/graph/api/user-sendmail]]. You then need to tick the "Emails will be sent using Microsoft Graph checkbox and click on the Settings link next to the checkbox. Then you need to enter values obtained from Microsoft. | |