Emails

How To...

configure the system to send e-mails

To configure the application to send e-mails you need to do the following:

  1. Define an intelligent business object representing the addressee of the e-mail with the communication channel of the “e-mail” type (see the “Defining Intelligent Business Objects” section).
  2. Define a notification representing a particular e-mail (see “Sending Outgoing E-mail” section).
  3. Define a business rule that would use the SEND action to send e-mail under particular circumstances – see the description of the SEND Action in the AwareIM Rule Language Reference.

See also the “Outgoing E-mail” section.

send e-mail with attachments

To send e-mails with attachments you need to configure a notification representing a particular e-mail (see the “Sending Outgoing E-mail” section) and define attributes of the Document type that will hold the attachments – one attribute per attachment (see the “Attributes of Document Type” section). When you send e-mail using the SEND action you need to initialize these attributes with the particular documents (these can be generated reports, “merged documents” or ordinary files). AwareIM will automatically convert these documents into e-mail attachments. For example,

CREATE EmailToCustomer WITH EmailToCustomer.Attachment1='AnnualReport'
SEND EmailToCustomer TO Customer 

In this example EmailToCustomer is a notification representing the e-mail (the notification must have the Subject and Message attributes initialized to some text). This notification has the attribute Attachment1 of the Document type. AnnualReport is the name of the document template of the Report type (see the “Reports” section). When initializing the Attachment1 attribute AwareIM will generate the report, attach it to the attribute and convert it to the e-mail attachment when the e-mail is sent. Another example:

CREATE EmailToCustomer WITH EmailToCustomer.Attachment1='AnnualReport'
IMPORT DOCUMENT EmailToCustomer.Attachment2 FROM 'c:\MyDocuments\myfile.bin'
SEND EmailToCustomer TO Customer 

In this example EmailToCustomer is assumed to have the second attribute of the Document type called Attachment2. After the notification has been created the value of this attribute is imported from file. When the e-mail is sent the file is converted to the e-mail attachment.

configure the system to receive e-mails

This is described in detail in the “Incoming E-mail” and “Setting Options for Incoming E-mail Handling” sections.

register (save) incoming e-mails in the system

You can ask AwareIM to register all incoming e-mails when you configure the properties of the incoming e-mail handling – see the “Setting Options for Incoming E-mail Handling” section.

process e-mail based on its contents

In order to process the received e-mails you need to define business rules attached to the event of receiving an e-mail notification – see the “Incoming E-mail” section. The rules may check the subject and/or body of the e-mail (or maybe who it is from and when it was sent) and perform the appropriate actions. For example,

IF IncomingEmail.Subject = 'Registration' AND IncomingEmail.From = 'John Smith' THEN ... 

If e-mails contain complex information that you want to analyse then this information may be encoded into the body of the message in a special format (you have to mandate that the senders of such e-mails encode the bodies of their e-mails in this format). The format is described in the SET Action section of the Rule Language Reference. Your rules can then decode the information contained in the body of the e-mail using the SET action. For example, if the body of the e-mail has the following string:

#Name#John Smith#State#NEW#Balance#100.0 

Then the following rule:

SET Account FROM IncomingEmail.Message 

will set the Name, State and Balance attributes of the Account objects to the values provided in the body of the e-mail ('John Smith', 'NEW' and 100.0). You can define other rules that will check these values and perform the appropriate actions if required.

To perform “mail-merge” of your outgoing e-mails do the following:

  1. Define a notification representing the e-mail – see the “Sending Outgoing E-mail” section, 0930_email_config
  2. Provide the initial values to the Message and Subject attributes of the e-mail notification to include the body and subject of your e-mail respectively (see the “Common Properties” section). Use tags inside the initialization text for those parts of the body and/or subject that will be “mail merged”. AwareIM will replace the tags with the appropriate values when the e-mail is sent. Below is an example of the initialization text for the Message attribute:
Dear <<Policy.Holder.Name>>,
 
Your policy is about to expire on <<Policy.ExpiryDate>>

send e-mails in HTML format

To send e-mails in the HTML format first define the text of the e-mail as HTML document template (see the “Adding/Editing Document Templates section). After that add an email notification as described in 0930_email_config. This notification will have the predefined HTMLMessage attribute of the Document type. Set initial value of this attribute to the name of the HTML document template. Then define a rule to send this e-mail as usual.