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

2_6_0:admin:notifications [2019/01/09 16:40]
127.0.0.1 external edit
2_6_0:admin:notifications [2019/04/23 17:23] (current)
vdumas [Defining recipients]
Line 35: Line 35:
  
 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 42: Line 43:
  
 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:
-<​code>​ +    ​SELECT Person WHERE name LIKE '​John%'​
-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 68: Line 64:
 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: ​''<​nowiki>​SELECT Person JOIN lnkContactToTicket AS L ON L.contact_id = Person.id WHERE L.ticket_id = :​this->​id</​nowiki>''​</​note>​+<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:\\ 
 +    ​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.txt · Last modified: 2019/04/23 17:23 by vdumas

";