Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:2500_config_apps:2600_emails:0200_outgoing_email [2025/06/11 08:35] – ↷ Page moved from docs:2500_config_apps:2300_emails:0200_outgoing_email to docs:2500_config_apps:2600_emails:0200_outgoing_email aware_support3docs:2500_config_apps:2600_emails:0200_outgoing_email [2026/07/09 05:39] (current) aware_admin
Line 1: Line 1:
 {{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
  
-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:+===== 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.
  
-===== Outgoing mail host =====+==== 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:
  
-The DNS name of your e-mail server that will send outgoing e-mails to the intelligent business object.+<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>
  
-===== "From" address =====+=== 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.\\
  
-The e-mail address that your e-mails to the business object will have as the “from” addressNote that the "from address" must be recognized by your email server, so it must be registered on this server.+==== 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 commandThis 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.
  
-===== Login details =====+==== 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.
  
-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.+==== E-mail Notification ====
  
-====== OAuth Support ====== +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:
-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]] +
-====== E-mail Notification ====== +
- +
-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:+
  
   - ''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.
Line 43: Line 72:
 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 notificationAt run time you should populate this attribute with some document, **AwareIM will automatically use this document as an e-mail attachment
-If you want to use an email account directly in the ''[[a_f:a:send|SEND]]'' action you need to do the following: +</callout>
- +
-  - 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 commandThis command will create the object with the required predefined attributes +
-  Define the ''[[a_f:a:send|SEND]]'' action with the ''USING'' syntaxThe 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.+
  
 +==== 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