The purpose of this detector is to send a custom message to the creator of an issue (typically a customer using a company support email address).
1 # if you have non-ascii-chars in your message
2 # you have to add this (or another suitable encoding)
3 # in the first or second line of the script :
4 # -*- coding: utf-8 -*-
5 #
6 # This detector will send a notification mail for issue-creating
7 # to the original reporter
8 #
9 # derived from newissuecopy.py
10 # modified by benjamin.baermann@attac.de
11 #
12
13 from roundup import roundupdb
14
15 def newissuecopy(db, cl, nodeid, oldvalues):
16 ''' Copy a message about new issues to a team address.
17 '''
18 # so use all the messages in the create
19 # change_note = cl.generateCreateNote(nodeid)
20 change_note =
21 ("\n-----------------------------------------------------------------------\n"
22 "insert your text here")
23
24 # send a copy to the nosy list
25 for msgid in cl.get(nodeid, 'messages'):
26 try:
27 creator = cl.get(nodeid, 'creator')
28 sender_address = db.user.get(creator, 'address')
29 # note: last arg must be a list
30 cl.send_message(nodeid, msgid, change_note, [sender_address])
31
32 except roundupdb.MessageSendError, message:
33 raise roundupdb.DetectorError, message
34
35 def init(db):
36 db.issue.react('create', newissuecopy)