Email rules

From Catglobe Wiki
Jump to: navigation, search



Email rules

Email rules can be accessed from the accounts dialog. Any email rule must belong to a main account. Accounts can although have multiple rules.

Emailrules581-1

Click add to create a new email rule and edit to modify an existing rule. This will open the following dialogue.

Emailrules581-2

Each rule has some criteria which you can define to specify for which e-mails the rule will apply. And it has some actions to define what will happen to the emails for which the criteria applies. If an incoming e-mail meets the criteria of one rule, the action is applied.

The criteria that exists for selecting e-mails for a rule are; To e-mail, From e-mail, Subject, Message and Header contains. It is only for the To E-mail where an exact match is required. For the other rules the inserted string just needs to be part of the tested e-mail. If e.g. Subject for the rule is "Coca" then all e-mails with "Coca-Cola" in subject will also fulfill this criteria. The Header contains field is for advanced users who know how the hidden "codes" in e-mail headers look. An example of a  header criteria could be "x-sender: kiima@ozonic.com" or "X-ExchangeSecure-AntiSpam: spam". This would mean that all headers containing the keys "x-sender" where value looks like %kiima@ozonic.com% and key "X-ExchangeSecure-AntiSpam" where value looks like %spam% will fulfill this rule. To add multiple rules for "header contains" please place each rule in a separate line in the text box.

In the above dialogue example, if an incoming mail is sent to support@vietnam.catglobe.com and in the Subject field includes the string "[Spam]", then the e-mail will be moved to the Inbox of the ARCHIVE resource. As you can see we can combine a number of different rules based on whom the e-mail is to, whom an e-mail is from, and what key words are found in the subject and message areas.

Distribution rules offer 6 different types of actions (chosen in the Type dropdown). These are explained in turn below>

Move: When choosing this type, you will be asked to choose a mailfolder (typically inbox) of another resource to which incoming emails caught by this rule should be moved to.

Copy: If you want to leave a copy in the original resource, but still want a copy another place, you can use this type. When choosing this type, you will be asked to choose a mailfolder (typically inbox) of another resource to which incoming emails caught by this rule should be copied to.

Forward: If you want the incoming email caught by this rule to be forwarded to another email address, then use this rule. The stated email does not need to exist in the Catglobe system.

Reply: When choosing this type, you will be asked to specify the mail template to be used for the reply email. An email reply will then automatically be returned for any incoming email caught by this rule.

Delete: When you choose this type, any email caught will immediately get deleted. Good way to handle spammail.

Execute CGScript: This is a more advanced - but nonetheless extremely smart option. This rule offers you to choose a workflow or tabulation script. When an email with this keyword is received by Catglobe then the chosen script will be run. The SMS message will exist in context of the script and can thus be used to insert into e.g. a task or project.


Index

Data type

Value

EMAIL_FROM

string

The sender's email address

EMAIL_TO_RESOURCE_ID

Number

The resource ID of the resource to which the email is delivered

EMAIL_TO_ADDRESSES

string

The recipients' email addresses, including Cc recipients'.

EMAIL_HEADERS

string

The headers of the email

EMAIL_SUBJECT

string

The subject of the email

EMAIL_CONTENT

string

The content of the email

Example : On the workflow using for adding the journal basing on the email content :

array emailparameter=Workflow_getParameters();

string fromemail = emailparameter[EMAIL_FROM];

number parentResourceId = emailparameter[EMAIL_TO_RESOURCE_ID];

string toemail = emailparameter[EMAIL_TO_ADDRESSES];

string headeremail = emailparameter[EMAIL_HEADERS];

string headeremail = emailparameter[EMAIL_SUBJECT];

string contentemail = emailparameter[EMAIL_CONTENT];

addJournal(197653,6, "Comment",convertToString(emailparameter));