This commit was generated by cvs2svn to compensate for changes in r2523,
[freeside.git] / rt / docs / design_docs / subscription-definitions.txt
1 NEW SCRIP NOTES
2
3
4 RT Actions:
5
6
7    EmailOwnerAsComment
8         Send mail to the ticket owner from the queue's comment address
9         
10    EmailOwnerOrAdminWatchersAsComment
11         Send mail to the ticket owner, or if there is no owner, the ticket's admin watchers
12         from the queue's comment addresses
13
14    EmailAdminWatchersAsComment
15         Send mail to the ticket's adminstrative watchers from the queue's comment address
16
17
18
19    EmailOwner
20         Send mail to the ticket owner from the queue's correspond address
21         
22    EmailOwnerOrAdminWatchers
23         Send mail to the ticket owner, or if there is no owner, the ticket's admin watchers
24         from the queue's correspond addresses
25
26    EmailAdminWatchers
27         Send mail to the ticket's adminstrative watchers from the queue's correspond address
28
29    EmailWatchers
30         Send mail to the ticket watchers from the queue's correspond address
31
32    AutoReply 
33         Sendmail to the requestor from the queue's correspond address.
34              
35    
36
37 RT Conditions:
38    OnCreate
39    OnEachTransaction
40    OnComment
41    OnCorrespond
42    
43
44
45
46
47 What is an Action?
48
49 ...some piece of code that can do something whenever a transaction is done.
50 The actions shipped with RT sends email and can handle some logic that makes
51 sense for some instances.  site-specific modules can be dropped in to
52 perform special actions.
53
54
55 What can an Action do?
56
57 - decide whether it's applicable or not
58 - prepare
59 - commit
60 - describe itself
61
62 ...and if it's a subclass of SendEmail, you can also override a lot.
63
64 Currently the schema.mysql contains a list of the basic subscription-related
65 actions that will be bundled with RT.
66
67
68 What is a Scrip?
69
70 ...it's an entry in the database that tells that an action is to be
71 performed with a certain template and argument.  Template and argument
72 doesn't make sense in all contexts.  A scrip can be limited to transaction
73 types; the current implementation allows a comma-separated list (though for
74 a "cleaner" schema design, it should be a separate table for this?).  It has
75 a name and a description.
76
77
78 What is a ScripScope?
79
80 ...an indication of what queues the different Scrips applies to.  It should
81 be easy to remove/insert ScripScope objects by the admin tools.
82
83
84 What is a Watcher?
85
86 ...it's a request for beeing kept updated on a ticket and/or a queue
87 and/or whatever.  It is to be used by the Actions.  Watcher items can
88 easily be enabled/disabled through the `Quiet' attribute.  `Type' might
89 indicate what emails the watcher wants to get and how to get them.
90
91 The Bcc/Cc watchers should be handled by the NotifyWatchers action which is
92 run regardless of the Scrips.
93
94
95 What is a Template?
96
97 ...A template is a text template that is to be used for outgoing email -
98 or for different use for different actions.  One template can be used by
99 several Scrips.
100
101
102 How does the system determinate whom to send mail to?
103
104 The ScripScope table in the DB should indicate whether a Scrip is relevant
105 for a queue or not /* TobiX thinks that this might eventually be extended to
106 keywords, tickets, etc, and not only Queues */ ... the Scope table should
107 indicate whether the Scrip is relevant for a given transaction type ... then
108 the given Action should determinate whether it applies or not, and finally
109 the Action has to find out (via the Watchers table) whom it applies to, and
110 how to contact them ... and the Template tells how the mails that are sent
111 out should look like.
112
113