Changeset 711

Show
Ignore:
Timestamp:
02/06/03 00:55:02 (21 years ago)
Author:
jalet
Message:

Cleaner email messages

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r709 r711  
    1515# 
    1616# $Log$ 
     17# Revision 1.6  2003/02/05 23:55:02  jalet 
     18# Cleaner email messages 
     19# 
    1720# Revision 1.5  2003/02/05 23:45:09  jalet 
    1821# Better DateTime manipulation wrt grace delay 
     
    6669    def sendMessage(self, touser, fullmessage) : 
    6770        """Sends an email message containing headers to some user.""" 
    68         fullmessage += "\n\nPlease contact your system administrator %s - <%s>\n" % (self.admin, self.adminmail) 
    6971        if "@" not in touser : 
    7072            touser = "%s@%s" % (touser, self.smtpserver) 
     
    7577    def sendMessageToUser(self, username, subject, message) : 
    7678        """Sends an email message to a user.""" 
     79        message += "\n\nPlease contact your system administrator :\n\n\t%s - <%s>\n" % (self.admin, self.adminmail) 
    7780        self.sendMessage(username, "Subject: %s\n\n%s" % (subject, message)) 
    7881         
     
    118121            adminmessage = "Print Quota exceeded for user %s on printer %s" % (username, self.printername) 
    119122            self.logger.log_message(adminmessage) 
    120             self.sendMessageToUser(username, "Print Quota Exceeded", "You are not allowed to print anymore because your Print Quota is exceeded.") 
     123            self.sendMessageToUser(username, "Print Quota Exceeded", "You are not allowed to print anymore because\nyour Print Quota is exceeded.") 
    121124            self.sendMessageToAdmin("Print Quota", adminmessage) 
    122125        elif action == "WARN" :     
    123126            adminmessage = "Print Quota soft limit exceeded for user %s on printer %s" % (username, self.printername) 
    124127            self.logger.log_message(adminmessage) 
    125             self.sendMessageToUser(username, "Print Quota Exceeded", "You will soon be forbidden to print anymore because your Print Quota is almost reached.") 
     128            self.sendMessageToUser(username, "Print Quota Exceeded", "You will soon be forbidden to print anymore because\nyour Print Quota is almost reached.") 
    126129            self.sendMessageToAdmin("Print Quota", adminmessage) 
    127130        return action