def __sendEmailEarlyNotification(self, reservation, notificationDay): subject = "Your reservation (id = " + str(reservation.getReservationID()) + \ ") expires in " + str(notificationDay) + " days" body = "The reservation you made will expire in " + str(notificationDay) + " days. " + \ "Please renew it by logging on to hen.cs.ucl.ac.uk and running the command 'hm reservation'. " + \ "Failure to do so will result in its automatic deletion from the testbed." if not self.__debug: log.info("Sent email to "+str(reservation.getEmail())+" via "+str(self.__smtpServerName)+" at "+str(datetime.datetime.now())) smtpClient = SMTPClient(self.__smtpServerName) smtpClient.sendEmail(reservation.getEmail(), self.__daemonEmail, subject, body) smtpClient.close() else: print "would send email." print "to :"+str(reservation.getEmail()) print "subject :"+subject print "via :"+self.__smtpServerName print "body :"+body
def __sendEmailExpired(self, reservation,dirListing=None): subject = "Your reservation (id = " + str(reservation.getReservationID()) + ") has expired" body = "The reservation you had made has expired and has been removed from the system. " + \ "If you still wish to use the devices you had reserved you will have to create a new " + \ "reservation by logging on to hen.cs.ucl.ac.uk and running the command 'hm reservation'." if dirListing != None: body += "The directory listings for your machines were :\n" body += dirListing if not self.__debug: smtpClient = SMTPClient(self.__smtpServerName) smtpClient.sendEmail(reservation.getEmail(), self.__daemonEMail, subject, body) smtpClient.close() else: print "would send email." print "to :"+str(reservation.getEmail()) print "subject :"+subject print "via :"+self.__smtpServerName print "body :"+body
def __sendEmailExpired(self, reservation, dirListing=None): subject = "Your reservation (id = " + str( reservation.getReservationID()) + ") has expired" body = "The reservation you had made has expired and has been removed from the system. " + \ "If you still wish to use the devices you had reserved you will have to create a new " + \ "reservation by logging on to hen.cs.ucl.ac.uk and running the command 'hm reservation'." if dirListing != None: body += "The directory listings for your machines were :\n" body += dirListing if not self.__debug: smtpClient = SMTPClient(self.__smtpServerName) smtpClient.sendEmail(reservation.getEmail(), self.__daemonEMail, subject, body) smtpClient.close() else: print "would send email." print "to :" + str(reservation.getEmail()) print "subject :" + subject print "via :" + self.__smtpServerName print "body :" + body
def __sendEmailEarlyNotification(self, reservation, notificationDay): subject = "Your reservation (id = " + str(reservation.getReservationID()) + \ ") expires in " + str(notificationDay) + " days" body = "The reservation you made will expire in " + str(notificationDay) + " days. " + \ "Please renew it by logging on to hen.cs.ucl.ac.uk and running the command 'hm reservation'. " + \ "Failure to do so will result in its automatic deletion from the testbed." if not self.__debug: log.info("Sent email to " + str(reservation.getEmail()) + " via " + str(self.__smtpServerName) + " at " + str(datetime.datetime.now())) smtpClient = SMTPClient(self.__smtpServerName) smtpClient.sendEmail(reservation.getEmail(), self.__daemonEmail, subject, body) smtpClient.close() else: print "would send email." print "to :" + str(reservation.getEmail()) print "subject :" + subject print "via :" + self.__smtpServerName print "body :" + body