User Tools

Site Tools

:: Version 2.6.0 ::

2_6_0:admin:notifications

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
2_6_0:admin:notifications [2019/04/23 17:23]
vdumas [Defining recipients]
2_6_0:admin:notifications [2020/02/05 11:42] (current)
Line 28: Line 28:
  
 The mandatory fields for an email action are: The mandatory fields for an email action are:
-  * Subject: the subject of the message. May be built dynamically by using placeholders as described herebelow. +  ​* **Subject**: the subject of the message. May be built dynamically by using placeholders as described herebelow. 
-  * Body: the body of the message. May be built dynamically by using placeholders as described herebelow. By default iTop sends all the messages with the MIME Type text/html for the body of the email. +  ​* **Body**: the body of the message. May be built dynamically by using placeholders as described herebelow. By default iTop sends all the messages with the MIME Type text/html for the body of the email. 
-  * From: this field contains ​a static email address. Note that some email servers will reject the message if the "​from"​ address is not valid.+  ​* **From**Either ​a static email address ​or a placeholder like ''​$this->​agent_id->​email$''​. Note that some email servers will reject the message if the "​from"​ address is not valid.
  
 +Other fields:
 +  * **Description**:​ free text to identify the purpose of the email action. Not sent within the email message.
 +  * **Status**: ​
 +    * In production: email are sent to people retrieved by To, Cc and Bcc queries
 +    * Being tested: email are sent to ''​Test recipient''​ email address
 +    * Inactive: email are not sent
 +  * **Test recipient**:​ email address used instead of To, Cc and Bcc when the status is ''​Being tested''​
 +  * **Reply to**: Either a static email address or a placeholder like ''​$this->​team_id->​email$''​. This a standard attribute of an email message. It is used automatically by mailing tools as the address to use, when the user does "​reply"​ on the email in his mailer. If omitted the ''​from''​ address is used.
 ===== Defining recipients ===== ===== Defining recipients =====
  
 The contacts to be notified in the “To”, “Cc”, and “Bcc” are defined by an OQL query. This allows to specify multiple recipients for the notification,​ like “all the contacts attached to a ticket” or “all the contacts on the impacted site”. (Refer to [[2_6_0:​oql:​start|Object Query Language Reference]] for more information about writing OQL queries) The contacts to be notified in the “To”, “Cc”, and “Bcc” are defined by an OQL query. This allows to specify multiple recipients for the notification,​ like “all the contacts attached to a ticket” or “all the contacts on the impacted site”. (Refer to [[2_6_0:​oql:​start|Object Query Language Reference]] for more information about writing OQL queries)
- 
  
 This OQL query must return a list of objects containing an email attribute, namely: This OQL query must return a list of objects containing an email attribute, namely:
Line 43: Line 50:
  
 For instance, to notify all persons whose name starts with John, the **To** field can contain: For instance, to notify all persons whose name starts with John, the **To** field can contain:
-    ​SELECT Person WHERE name LIKE '​John%'​+<​code>​ 
 +SELECT Person WHERE name LIKE '​John%'​ 
 +</​code>​
  
 The query can contain placeholders that refer to the current object for which the notification is being sent. The syntax is ''<​nowiki>:​this->​attribute</​nowiki>''​. The query can contain placeholders that refer to the current object for which the notification is being sent. The syntax is ''<​nowiki>:​this->​attribute</​nowiki>''​.
  
 For example, to send a notification to the person who is the "​caller"​ of a ticket, the **To** field will contain: For example, to send a notification to the person who is the "​caller"​ of a ticket, the **To** field will contain:
-    ​SELECT Person WHERE id= :​this->​caller_id+ 
 +<​code>​ 
 +SELECT Person WHERE id= :​this->​caller_id 
 +</​code>​
  
 The query can contain placeholders that refer to the current contact which has done the action at the origin of the event (might be an issue if the user is not linked to a contact). The syntax is ''<​nowiki>:​current_contact->​attribute</​nowiki>''​. The query can contain placeholders that refer to the current contact which has done the action at the origin of the event (might be an issue if the user is not linked to a contact). The syntax is ''<​nowiki>:​current_contact->​attribute</​nowiki>''​.
Line 64: Line 76:
 If the list returned by the query is empty no email will be sent. If the list returned by the query is empty no email will be sent.
  
-<note tip>To notify all the Persons attached to the Ticket (i.e. all the Persons in the "​Contacts"​ tab) the OQL query to be used as recipients (either **To**, **CC** or **Bcc**) is the following:\\ +<note tip>To notify all the Persons attached to the Ticket (i.e. all the Persons in the "​Contacts"​ tab) the OQL query to be used as recipients (either **To**, **CC** or **Bcc**) is the following: ​''<​nowiki>​SELECT Person JOIN lnkContactToTicket AS L ON L.contact_id = Person.id WHERE L.ticket_id = :​this->​id</​nowiki>''​</​note>​
-    ​SELECT Person ​ +
-    ​JOIN lnkContactToTicket AS L ON L.contact_id = Person.id ​ +
-    ​WHERE L.ticket_id = :​this->​id +
-</note> +
- +
- +
-<note tip>To notify all the Persons attached to CIs attached to the Ticket, uses: \\ +
-    SELECT Person AS P  +
-    JOIN lnkContactToFunctionalCI AS L1 ON L1.contact_id = P.id  +
-    JOIN FunctionalCI AS CI ON L1.functionalci_id = CI.id  +
-    JOIN lnkFunctionalCIToTicket AS L2 ON L2.functionalci_id = CI.id  +
-    WHERE L2.ticket_id = :​this->​id +
-</​note>​+
  
 ===== Message contents and placeholders ===== ===== Message contents and placeholders =====
2_6_0/admin/notifications.1556033022.txt.gz · Last modified: 2019/04/23 17:23 by vdumas

";