X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Froundup-reminder;h=922fe62d52bfe371216f2bb3688cc2ebefdd7804;hb=47cde0d6fb759784f9f122430c35727f752a727d;hp=ad7ca425efa7b0d377f5807996aba98bbcc7b3cb;hpb=ca465310b238213b8c5c59e3d97162a4bbb11717;p=roundup.git diff --git a/scripts/roundup-reminder b/scripts/roundup-reminder index ad7ca42..922fe62 100755 --- a/scripts/roundup-reminder +++ b/scripts/roundup-reminder @@ -19,7 +19,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# $Id: roundup-reminder,v 1.3 2002-09-10 01:07:06 richard Exp $ +# $Id: roundup-reminder,v 1.6 2003-04-24 07:19:59 richard Exp $ ''' Simple script that emails all users of a tracker with the issues that @@ -32,8 +32,9 @@ Note: The instance that this script was designed for has a modified schema! You will want to modify this script to customise it for your own schema! ''' -import cStringIO, MimeWriter, smtplib +import sys, cStringIO, MimeWriter, smtplib from roundup import instance, date +from roundup.mailgw import openSMTPConnection # open the instance if len(sys.argv) != 2: @@ -73,14 +74,14 @@ for user_id in db.user.list(): # generate the email message message = cStringIO.StringIO() writer = MimeWriter.MimeWriter(message) - writer.addheader('Subject', 'Your active %s issues'%db.config.INSTANCE_NAME) + writer.addheader('Subject', 'Your active %s issues'%db.config.TRACKER_NAME) writer.addheader('To', address) - writer.addheader('From', '%s <%s>'%(db.config.INSTANCE_NAME, + writer.addheader('From', '%s <%s>'%(db.config.TRACKER_NAME, db.config.ADMIN_EMAIL)) - writer.addheader('Reply-To', '%s <%s>'%(db.config.INSTANCE_NAME, + writer.addheader('Reply-To', '%s <%s>'%(db.config.TRACKER_NAME, db.config.ADMIN_EMAIL)) writer.addheader('MIME-Version', '1.0') - writer.addheader('X-Roundup-Name', db.config.INSTANCE_NAME) + writer.addheader('X-Roundup-Name', db.config.TRACKER_NAME) # start the multipart part = writer.startmultipartbody('alternative') @@ -110,7 +111,7 @@ To view or respond to any of the issues listed above, visit the URL %s and click on "My Issues". Do NOT respond to this message. -'''%db.config.ISSUE_TRACKER_WEB +'''%db.config.TRACKER_WEB # now the HTML one @@ -132,7 +133,7 @@ and click on "My Issues". Do NOT respond to this message. creation = creation_date.pretty() if not timeliness_id: timeliness_id = ' ' title = db.issue.get(issue_id, 'title') - issue_id = '%s'%(db.config.ISSUE_TRACKER_WEB, + issue_id = '%s'%(db.config.TRACKER_WEB, issue_id, issue_id) colour = colours.get(timeliness, '') print >>body, '''%s%s%s @@ -147,7 +148,7 @@ and click on "My Issues". Do NOT respond to this message. writer.lastpart() # all done, send! - smtp = smtplib.SMTP(db.config.MAILHOST) + smtp = openSMTPConnection(db.config) smtp.sendmail(db.config.ADMIN_EMAIL, address, message.getvalue()) # vim: set filetype=python ts=4 sw=4 et si