def __init__(self, booking): WebExAdminNotificationBase.__init__(self, booking) self.setSubject("""[WebEx] WebEx meeting modified: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) body_text = "Dear WebEx Responsible,<br /> There has been a change on %s to the WebEx meeting %s. <br/><br/>" % (MailTools.getServerName(), self._conference.getTitle() ) # if len( booking.getLatestChanges() ) > 0: # body_text += "<ul>\n" # for change in booking.getLatestChanges(): # body_text += "<li>" + change + "</li>\n" # body_text += "</ul>\n" the_body2 = """ <br /> See the event page here: %s <br/> The full details are below: <br /> %s <br /> %s <br /> <br /> %s """ % ( self._modifLink, MailTools.eventDetails(self._conference), MailTools.organizerDetails(self._conference), self._getBookingDetails() ) self.setBody(body_text + the_body2)
def sendParticipantsEmail(self, operation): params = self.getBookingParams() try: if params.has_key('sendAttendeesEmail') and params['sendAttendeesEmail'][0].lower() == 'yes': recipients = [] for k in self._participants.keys(): recipients.append( self._participants[k]._email ) if len(recipients)>0: if operation == 'remove': notification = WebExParticipantNotification( self,recipients, operation ) GenericMailer.send( notification ) else: notification = WebExParticipantNotification( self,recipients, operation, additionalText="This is a WebEx meeting invitation.<br/><br/>" ) GenericMailer.send( notification ) if params.has_key('sendCreatorEmail') and params['sendCreatorEmail'][0].lower() == 'yes': recipients = MailTools.getManagersEmailList(self.getConference(), 'WebEx') notification = WebExParticipantNotification( self,recipients, operation, additionalText="Dear event manager:<br/><br/>\n\n " ) GenericMailer.send( notification ) if params.has_key('sendSelfEmail') and params['sendSelfEmail'][0].lower() == 'yes' and params.has_key("loggedInEmail") and params["loggedInEmail"] != "": recipients = [ params["loggedInEmail"] ] notification = WebExParticipantNotification( self,recipients, operation, additionalText="You are receiving this email because you requested it when creating a WebEx booking via Indico.<br/><br/>\n\n " ) GenericMailer.send( notification ) except Exception,e: Logger.get('WebEx').error( """Could not send participant email for booking with id %s of event with id %s, operation %s, exception: %s""" % (self.getId(), self.getConference().getId(), operation, str(e))) Logger.get('WebEx').error( MailTools.getManagersEmailList(self.getConference(), 'WebEx') ) self._warning = _("The operation appears to have been successful, however there was an error in sending the emails to participants: %s" % str(e) )
def __init__(self, booking): RecordingRequestAdminNotificationBase.__init__(self, booking) self.setSubject("""[RecReq] New recording request: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Recording Manager,<br /> <br /> There is a <strong>new recording request</strong> in <a href="%s">%s</a><br /> Click <a href="%s">here</a> to accept or reject the request.<br /> <br /> %s <br /> %s <br /> %s <br /> <br /> %s """ % ( MailTools.getServerName(), MailTools.getServerName(), self._modifLink, MailTools.currentUserDetails('Requester'), MailTools.organizerDetails(self._conference), MailTools.eventDetails(self._conference), self._getRequestDetails('new') ))
def _getTalks(self): if self._isLecture: return """(This event is a lecture. Therefore, it has no talks)""" else: #"all" "choose" "neither" if self._bp["talks"] == "all": text = ["""The user chose "All Talks". List of talks:"""] allTalks = getTalks(self._conference) if allTalks: text.extend(MailTools.talkListText(self._conference, allTalks)) text.append("<strong>Important note:</strong> room is only shown if different from event.") else: text.append("(This event has no talks)") return "<br />".join(text) elif self._bp["talks"] == "neither": return """Please see the talk selection comments""" else: text = ["""The user chose the following talks:"""] selectedTalks = [self._conference.getContributionById(contribId) for contribId in self._bp["talkSelection"]] if selectedTalks: text.extend(MailTools.talkListText(self._conference, selectedTalks)) text.append("<strong>Important note:</strong> room is only shown if different from event.") else: text.append("(User did not choose any talks)") return "<br />".join(text)
def _getRequestDetails(self, typeOfMail): bp = self._bp return """ Request details:<br /> <table style="border-spacing: 10px 10px;"> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Request id:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Creation date:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> %s <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Talk(s) to be webcasted:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td colspan="2"> <strong>Audience:</strong><br /> %s </td> </tr> <tr> <td colspan="2"> <strong>Additional comments:</strong><br /> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>List of talks to be webcasted:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> </table> """ % (self._booking.getId(), MailTools.bookingCreationDate(self._booking), MailTools.bookingModificationDate(self._booking, typeOfMail), self._getTalksShortMessage(), self._bp["audience"] or _("Public"), self._getComments(), self._getTalks())
def _getBookingDetails(self, typeOfMail): return """ Booking / request details:<br /> <table style="border-spacing: 10px 10px;"> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Type:</strong> </td> <td style="vertical-align: top;"> %(type)s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>id:</strong> </td> <td style="vertical-align: top;"> %(id)s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Modification link:</strong> </td> <td style="vertical-align: top;"> <a href="%(modifURL)s">link</a> </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Creation date:</strong> </td> <td style="vertical-align: top;"> %(creationDate)s </td> </tr> %(modificationDate)s <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Booking parameters:</strong> </td> <td style="vertical-align: top;"> %(bookingParams)s </td> </tr> </table> """%{"type": self._booking.getType(), "id" : self._booking.getId(), "modifURL": self._modifLink, "creationDate": MailTools.bookingCreationDate(self._booking), "modificationDate": MailTools.bookingModificationDate(self._booking, typeOfMail), "bookingParams": beautify(self._bp) }
def _getPurposes(self): purposes = self._bp['recordingPurpose'] rpdict = dict(recordingPurpose) if purposes: return MailTools.listToStr([rpdict[k] for k in purposes]) else: return "No purposes were selected"
def _getAudiences(self): audiences = self._bp['intendedAudience'] iadict = dict(intendedAudience) if audiences: return MailTools.listToStr([iadict[k] for k in audiences]) else: return "No audiences were selected"
def _getMatters(self): matters = self._bp['subjectMatter'] smdict = dict(subjectMatter) if matters: return MailTools.listToStr([smdict[k] for k in matters]) else: return "No audiences were selected"
def __init__(self, booking): RecordingRequestAdminNotificationBase.__init__(self, booking) self.setSubject("""[RecReq] Recording request accepted: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Recording Responsible,<br /> <br /> A recording request for the event: "%s" has been accepted in <a href="%s">%s</a><br /> Click <a href="%s">here</a> to view the request.<br /> """ % ( self._conference.getTitle(), MailTools.getServerName(), MailTools.getServerName(), self._modifLink ))
def _getLectureOptions(self): options = self._bp['lectureOptions'] lodict = dict(lectureOptions) if options: return MailTools.listToStr([lodict[k] for k in options]) else: return "No lecture options were selected"
def __init__(self, booking, user = None): RecordingRequestAdminNotificationBase.__init__(self, booking) self.setSubject("""[RecReq] Recording request accepted: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) userInfo = "" if user : userInfo = " by %s %s"%(user.getFirstName(), user.getFamilyName().upper()) self.setBody("""Dear Recording Manager,<br /> <br /> A recording request for the event: "%s" has been accepted in <a href="%s">%s</a>"""%(self._conference.getTitle(), MailTools.getServerName(), MailTools.getServerName()) + userInfo + """.<br /> Click <a href="%s">here</a> to view the request.<br /> """ % ( self._modifLink ))
def __init__(self, booking): VidyoAdminNotificationBase.__init__(self, booking) currentCount = VidyoTools.getEventEndDateIndex().getCount() self.setSubject("""[Vidyo] Too many public rooms (%s)""" % str(currentCount)) self.setBody("""Dear Vidyo Manager,<br /> <br /> There are currently %s Vidyo public rooms created by Indico in <a href="%s">%s</a>.<br /> The system was setup to send you a notification if this number was more than %s.<br /> Please go to the <a href="%s">Vidyo Plugin configuration</a> in the Server Admin interface and press the "Clean old rooms" button.<br /> """ % (str(currentCount), MailTools.getServerName(), MailTools.getServerName(), getVidyoOptionValue("cleanWarningAmount"), str(urlHandlers.UHAdminPlugins.getURL(CollaborationTools.getCollaborationPluginType()))))
def _delete(self): if MailTools.needToSendEmails('RecordingRequest'): try: notification = RequestDeletedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestDeletedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('remove', e)
def _sendResultEmail(cls, maxDate, previousTotal, newTotal, error, attainedDate): """ Sends a mail detailing how the operation went """ if MailTools.needToSendEmails('Vidyo'): try: notification = VidyoCleaningDoneNotification(maxDate, previousTotal, newTotal, error, attainedDate) GenericMailer.send(notification) except Exception, e: Logger.get('Vidyo').error( """Could not send VidyoCleaningDoneNotification, exception: %s""" % str(e))
def notifyLocationChange(self): if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestRelocatedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", self.getConference().getCreator()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestRelocatedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('edit', e)
def notifyEventDateChanges(self, oldStartDate, newStartDate, oldEndDate, newEndDate): manager = Catalog.getIdx("cs_bookingmanager_conference").get(self._conf.getId()) manager._changeConfStartDateInIndex(self, oldStartDate, newStartDate) if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestRescheduledNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestRescheduledNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('edit', e)
def notifyLocationChange(self): self.unindex_instances() self.index_instances() if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestRelocatedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestRelocatedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('edit', e)
def __init__(self, booking): CollaborationNotificationBase.__init__(self, booking) self.setSubject("""[Video Services] Booking / request deleted: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody( """ A booking / request was deleted in <a href="%s">%s</a> <br /><br /> %s <br /><br /> %s <br /><br /> %s """ % ( MailTools.getServerName(), MailTools.getServerName(), self._getBookingDetails('remove'), MailTools.eventDetails(self._conference), MailTools.organizerDetails(self._conference) ))
def __init__(self, booking): GenericNotification.__init__(self) self._booking = booking self._bp = booking._bookingParams self._conference = booking.getConference() self._modifLink = str(self._booking.getModificationURL()) self.setFromAddr("Indico Mailer <%s>"%Config.getInstance().getSupportEmail()) self.setToList(MailTools.getAdminEmailList()) self.setContentType("text/html")
def __init__(self, booking): WebExAdminNotificationBase.__init__(self, booking) self.setSubject("""[WebEx] WebEx meeting deleted: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear WebEx Responsible,<br /> <br /> A WebEx meeting <strong>was deleted</strong> in <a href="%s">%s</a><br /> <br /> %s <br /> %s <br /> <br /> %s """ % ( MailTools.getServerName(), MailTools.getServerName(), MailTools.eventDetails(self._conference), MailTools.organizerDetails(self._conference), self._getBookingDetails() ))
def __init__(self, booking): EVOAdminNotificationBase.__init__(self, booking) self.setSubject("""[EVO] EVO meeting deleted: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear EVO Manager,<br /> <br /> An EVO meeting <strong>was deleted</strong> in <a href="%s">%s</a><br /> <br /> %s <br /> %s <br /> <br /> %s """ % ( MailTools.getServerName(), MailTools.getServerName(), MailTools.eventDetails(self._conference), MailTools.organizerDetails(self._conference), self._getBookingDetails('remove') ))
def _getTalks(self): #"all" "choose" "neither" if self._bp["talks"] == "all": talkInfo = getCommonTalkInformation(self._conference) text = ["""The user chose "All webcast-able Talks". List of webcast-able talks:"""] webcastableTalks = talkInfo[2] if webcastableTalks: text.extend(MailTools.talkListText(self._conference, webcastableTalks)) text.append("<strong>Important note:</strong> room is only shown if different from event.") else: text.append("(This event has no webcast-able talks)") return "<br />".join(text) else: text = ["""The user chose the following talks:"""] selectedTalks = [self._conference.getContributionById(id) for id in self._bp["talkSelection"]] if selectedTalks: text.extend(MailTools.talkListText(self._conference, selectedTalks)) text.append("<strong>Important note:</strong> room is only shown if different from event.") else: text.append("(User did not choose any talks)") return "<br />".join(text)
def __init__(self, booking): WebcastRequestAdminNotificationBase.__init__(self, booking) self.setSubject("""[WebcastReq] Webcast request deleted: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Webcast Responsible,<br /> <br /> A webcast request <strong>has been withdrawn</strong> in <a href="%s">%s</a><br /> <br /> %s <br /> %s <br /> <br /> %s """ % ( MailTools.getServerName(), MailTools.getServerName(), MailTools.eventDetails(self._conference), MailTools.organizerDetails(self._conference), self._getRequestDetails('remove') ))
def _create(self): self._statusMessage = "Request successfully sent" self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('RecordingRequest'): try: notification = NewRequestNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send NewRequestNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('create', e)
def __init__(self, booking): RecordingRequestAdminNotificationBase.__init__(self, booking) self.setSubject("""[RecReq] Recording request rejected: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Recording Manager,<br /> <br /> A recording request for the event: "%s" has been rejected in <a href="%s">%s</a><br /> Click <a href="%s">here</a> to view the request.<br /> <br /> The reason given by the Webcast Responsible who rejected the request was: <br /> %s <br /> """ % ( self._conference.getTitle(), MailTools.getServerName(), MailTools.getServerName(), self._modifLink, self._booking.getRejectReason().strip() ))
def notifyEventDateChanges(self, oldStartDate, newStartDate, oldEndDate, newEndDate): manager = self._conf.getCSBookingManager() manager._changeConfStartDateInIndex(self, oldStartDate, newStartDate) if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestRescheduledNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", self.getConference().getCreator()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestRescheduledNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('edit', e)
def __init__(self, booking): RecordingRequestAdminNotificationBase.__init__(self, booking) self.setSubject("""[RecReq] Recording request withdrawn: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Recording Manager,<br /> <br /> A recording request <strong>has been withdrawn</strong> in <a href="%s">%s</a><br /> <br /> %s <br /> %s <br /> <br /> %s """ % ( MailTools.getServerName(), MailTools.getServerName(), MailTools.eventDetails(self._conference), MailTools.organizerDetails(self._conference), self._getRequestDetails('remove') ))
def _modify(self, oldBookingParams): self._statusMessage = "Request successfully sent" self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestModifiedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestModifiedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('edit', e)
def _delete(self): import MaKaC.webcast as webcast webcast.HelperWebcastManager.getWebcastManagerInstance().delForthcomingWebcast(self._conf) if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestDeletedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestDeletedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('remove', e)
def _modify(self, oldBookingParams): self._statusMessage = "Request successfully sent" self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('RecordingRequest'): try: notification = RequestModifiedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('RecReq').exception( """Could not send RequestModifiedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('edit', e)
def __init__(self, booking): WebcastRequestAdminNotificationBase.__init__(self, booking) self.setSubject( """[WebcastReq] New webcast request: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Webcast Manager,<br /> <br /> There is a <strong>new webcast request</strong> in <a href="%s">%s</a><br /> Click <a href="%s">here</a> to accept or reject the request.<br /> %s <br /> %s <br /> %s <br /> <br /> %s """ % (MailTools.getServerName(), MailTools.getServerName(), self._modifLink, MailTools.eventDetails( self._conference), MailTools.currentUserDetails('Requester'), MailTools.organizerDetails( self._conference), self._getRequestDetails('new')))
def _create(self): self._statusMessage = "Request successfully sent" self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('WebcastRequest'): try: notification = NewRequestNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('RecReq').exception( """Could not send NewRequestNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('create', e)
def notifyEventDateChanges(self, oldStartDate, newStartDate, oldEndDate, newEndDate): manager = self._conf.getCSBookingManager() manager._changeConfStartDateInIndex(self, oldStartDate, newStartDate) if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestRescheduledNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('RecReq').exception( """Could not send RequestRescheduledNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('edit', e)
def __init__(self, booking): WebcastRequestAdminNotificationBase.__init__(self, booking) self.setSubject("""[WebcastReq] Webcast request relocated: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Webcast Manager,<br /> <br /> A webcast request <strong>has been relocated</strong> in <a href="%s">%s</a><br /> Click <a href="%s">here</a> to view the request.<br /> %s <br /> %s <br /> <br /> %s """ % ( MailTools.getServerName(), MailTools.getServerName(), self._modifLink, MailTools.eventDetails(self._conference), MailTools.organizerDetails(self._conference), self._getRequestDetails('modify') ))
def _delete(self): import MaKaC.webcast as webcast webcast.HelperWebcastManager.getWebcastManagerInstance( ).delForthcomingWebcast(self._conf) if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestDeletedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('RecReq').exception( """Could not send RequestDeletedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('remove', e)
def __init__(self, booking): WebExAdminNotificationBase.__init__(self, booking) self.setSubject("""[WebEx] New WebEx meeting: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear WebEx Responsible,<br /> <br /> There is a <strong>new WebEx meeting</strong> in <a href="%s">%s</a><br /> Click <a href="%s">here</a> to see it in Indico.<br /> <br /> %s <br /> %s <br /> <br /> %s """ % ( MailTools.getServerName(), MailTools.getServerName(), self._modifLink, MailTools.eventDetails(self._conference), MailTools.organizerDetails(self._conference), self._getBookingDetails() ))
def __init__(self, booking): EVOAdminNotificationBase.__init__(self, booking) self.setSubject("""[EVO] EVO meeting modified: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear EVO Manager,<br /> <br /> An EVO meeting <strong>was modified</strong> in <a href="%s">%s</a><br /> Click <a href="%s">here</a> to see it in Indico.<br /> <br /> %s <br /> %s <br /> <br /> %s """ % ( MailTools.getServerName(), MailTools.getServerName(), self._modifLink, MailTools.eventDetails(self._conference), MailTools.organizerDetails(self._conference), self._getBookingDetails('modify') ))
def notifyLocationChange(self): self.unindex_instances() self.index_instances() if MailTools.needToSendEmails('RecordingRequest'): try: notification = RequestRelocatedNotification(self) GenericMailer.sendAndLog( notification, self.getConference(), "MaKaC/plugins/Collaboration/RecordingRequest/collaboration.py", self.getConference().getCreator()) except Exception, e: Logger.get('RecReq').exception( """Could not send RequestRelocatedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('edit', e)
def _modify(self): self._statusMessage = _("Request successfully sent") self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestModifiedNotification(self) GenericMailer.sendAndLog( notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", self.getConference().getCreator()) except Exception, e: Logger.get('RecReq').exception( """Could not send RequestModifiedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('edit', e)
def __init__(self, booking): VidyoOwnerNotificationBase.__init__(self) self._booking = booking self._owner = booking.getOwnerObject() self.setFromAddr("Indico Mailer <%s>" % Config.getInstance().getSupportEmail()) self.setContentType("text/html") event = booking.getConference() self.setToList([self._owner.getEmail()]) self.setSubject( """[Indico] You are the owner of a Vidyo public room attached to the event: %s""" % event.getTitle()) self.setBody("""Dear %s%s,<br /> <br /> A new Vidyo room was created in <a href="%s">Indico</a> for the event <a href="%s">%s</a>.<br /> You have been chosen as Owner of this Vidyo public room.<br /> <br /> This means you can manage the room through the Vidyo Desktop application and you will be able to:<br /> - Invite other users to the room,<br /> - Lock or unlock the room,<br /> - Fix a maximum number of attendees,<br /> - Expel people out of the room,<br /> - and other similar actions.<br /> <br /> You will not be able, however, to remove or modify the room from Indico, unless you also have management rights for the event.<br /> <br /> <a href="%s">Click here</a> to join the Vidyo room.<br /> <br /> Name of the room: %s<br /> Extension: %s<br /> PIN: %s<br /> Description: %s<br /> <br /> Thank you for using our system.<br /> """ % (self._getOwnerTitleText(), self._owner.getStraightFullName(), MailTools.getServerName(), urlHandlers.UHConferenceDisplay.getURL(event), event.getTitle(), booking.getURL(), booking.getBookingParamByName("roomName"), str(booking.getExtension()), self._getPinText(), booking.getBookingParamByName("roomDescription")))
def __init__(self, booking): EVOEventManagerNotificationBase.__init__(self, booking) self.setSubject("""[Indico] EVO Meeting deleted %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Conference Manager,<br /> <br /> An EVO meeting <strong>was deleted</strong> in your conference.<br /> <br /> %s <br /> You also can see a list of all the EVO meetings here: (not implemented yet).<br /> <br /> <br /> %s """ % ( MailTools.eventDetails(self._conference), self._getBookingDetails('remove') ))
def __init__(self, booking): if not getWebExOptionValueByName("sendMailNotifications"): return WebExEventManagerNotificationBase.__init__(self, booking) self.setSubject( """[Indico] WebEx Meeting deleted %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Conference Manager,<br /> <br /> A WebEx meeting <strong>was deleted</strong> in your conference.<br /> <br /> %s <br /> You also can see a list of all the EVO meetings here: (not implemented yet).<br /> <br /> <br /> %s """ % (MailTools.eventDetails(self._conference), self._getBookingDetails()))
def __init__(self, booking): EVOEventManagerNotificationBase.__init__(self, booking) self.setSubject( """[Indico] EVO meeting modified: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Conference Manager,<br /> <br /> An EVO meeting <strong>was modified</strong> in your conference.<br /> Click <a href="%s">here</a> to see it in Indico.<br /> <br /> %s <br /> <br /> %s <br /> Please note that the auto-join URL will not work until the EVO meeting time arrives. """ % (self._modifLink, MailTools.eventDetails( self._conference), self._getBookingDetails('modify')))
def __init__(self, booking): if not getWebExOptionValueByName("sendMailNotifications"): return WebExEventManagerNotificationBase.__init__(self, booking) self.setSubject( """[Indico] WebEx meeting modified: %s (event id: %s)""" % (self._conference.getTitle(), str(self._conference.getId()))) self.setBody("""Dear Conference Manager,<br /> <br /> An WebEx meeting <strong>was modified</strong> in your conference.<br /> Click <a href="%s">here</a> to see it in Indico.<br /> <br /> %s <br /> <br /> %s <br /> Please note that the auto-join URL will not work until the WebEx host starts the meeting. """ % (self._modifLink, MailTools.eventDetails( self._conference), self._getBookingDetails()))
def _getRequestDetails(self, typeOfMail): bp = self._bp return """ Request details:<br /> <table style="border-spacing: 10px 10px;"> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Request id:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Creation date:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> %s <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Talk(s) to be webcasted:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td colspan="2"> <strong>Comments about talk selection</strong><br /> %s </td> </tr> <tr> <td colspan="2"> <strong>Have all the speakers given permission to have their talks webcasted?</strong> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Lecture options:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Type of event:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Posting urgency:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Number of webcast viewers:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Number of recording viewers:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Number of attendees:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Webcast purpose(s):</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Intended audience(s):</strong> </td> <td style="vertical-align: top; white-space : nowrap;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Subject matter(s):</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td colspan="2"> <strong>Additional comments:</strong><br /> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>List of talks to be webcasted:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> </table> """ % (self._booking.getId(), MailTools.bookingCreationDate(self._booking), MailTools.bookingModificationDate(self._booking, typeOfMail), self._getTalksShortMessage(), self._getTalkSelectionComments(), bp["permission"], dict(lectureOptions)[bp["lectureOptions"]], dict(typeOfEvents)[bp['lectureStyle']], dict(postingUrgency)[bp['postingUrgency']], bp['numWebcastViewers'], bp['numRecordingViewers'], bp['numAttendees'], self._getPurposes(), self._getAudiences(), self._getMatters(), self._getComments(), self._getTalks())
def _getBookingDetails(self, typeOfMail): bp = self._bp return """ Request details:<br /> <table style="border-spacing: 10px 10px;"> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Booking id:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Creation date:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> %s <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Meeting title:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Meeting description:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Community:</strong> </td> <td style="vertical-align: top;"> %s (id: %s) </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Phone bridge ID:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Start date:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>End date:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Access password yes/no:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Auto-join URL:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> </table> """%(self._booking.getId(), MailTools.bookingCreationDate(self._booking), MailTools.bookingModificationDate(self._booking, typeOfMail), bp["meetingTitle"], bp["meetingDescription"], self._booking.getCommunityName(), bp["communityId"], self._booking.getPhoneBridgeId(), formatDateTime(self._booking.getAdjustedStartDate()), formatDateTime(self._booking.getAdjustedEndDate()), self._getHasAccessPassword(), self._getAutoJoinURL(typeOfMail) )
def __init__(self, booking): EVONotificationBase.__init__(self, booking) self.setToList(MailTools.getAdminEmailList('EVO'))
def _getRequestDetails(self, typeOfMail): bp = self._bp return """ Request details:<br /> <table style="border-spacing: 10px 10px;"> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Request id:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Creation date:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> %s <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Talk(s) to be recorded:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Posting urgency:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Number of remote viewers:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Number of attendees:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td colspan="2"> <strong>Additional comments:</strong><br /> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>List of talks to be recorded:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> </table> """ % (self._booking.getId(), MailTools.bookingCreationDate(self._booking), MailTools.bookingModificationDate( self._booking, typeOfMail), self._getTalksShortMessage(), dict(postingUrgency)[bp['postingUrgency']], str(bp['numRemoteViewers']), str(bp['numAttendees']), self._getComments(), self._getTalks())
def __init__(self, booking): RecordingRequestNotificationBase.__init__(self, booking) self.setToList(MailTools.getAdminEmailList('RecordingRequest'))
def __init__(self, booking): WebcastRequestNotificationBase.__init__(self, booking) self.setToList( MailTools.getManagersEmailList(self._conference, 'WebcastRequest'))
def __init__(self, booking): WebcastRequestNotificationBase.__init__(self, booking) self.setToList(MailTools.getAdminEmailList('WebcastRequest'))
def _accept(self, user=None): self._statusMessage = "Request accepted" self._statusClass = "statusMessageOK" try: notification = RequestAcceptedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('RecReq').exception( """Could not send RequestAcceptedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('accept', e) if MailTools.needToSendEmails('RecordingRequest'): try: notificationAdmin = RequestAcceptedNotificationAdmin( self, user) GenericMailer.sendAndLog(notificationAdmin, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('RecReq').exception( """Could not send RequestAcceptedNotificationAdmin for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('accept', e) manager = Catalog.getIdx("cs_bookingmanager_conference").get( self._conf.getId()) manager.notifyInfoChange()
def __init__(self, booking): VidyoNotificationBase.__init__(self, booking) self.setToList(MailTools.getAdminEmailList('Vidyo')) self.setCCList(MailTools.getAdminEmailList())
def __init__(self, booking): VidyoNotificationBase.__init__(self, booking) self.setToList( MailTools.getManagersEmailList(self._conference, 'Vidyo'))
def _getBookingDetails(self, typeOfMail): bp = self._bp return """ Public room details:<br /> <table style="border-spacing: 10px 10px;"> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Booking id:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Creation date:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> %s <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Public room name:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Room owner:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Public room description:</strong> </td> <td style="vertical-align: top;"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Pin yes/no:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Manager chose to show PIN:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Auto-join URL:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> <tr> <td style="vertical-align: top; white-space : nowrap;"> <strong>Visibilty:</strong> </td> <td style="vertical-align: top"> %s </td> </tr> </table> """ % ( self._booking.getId(), MailTools.bookingCreationDate(self._booking), MailTools.bookingModificationDate(self._booking, typeOfMail), bp["roomName"], self._getOwnerText(), bp["roomDescription"], self._getHasPin(), self._getShowPin(), self._getAutoJoinURL(typeOfMail), self._getVisibility(), )
self._statusMessage = "Request accepted" self._statusClass = "statusMessageOK" import MaKaC.webcast as webcast webcast.HelperWebcastManager.getWebcastManagerInstance().addForthcomingWebcast(self._conf, self._bookingParams.get("audience", "")) try: notification = RequestAcceptedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", None) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestAcceptedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('accept', e) if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestAcceptedNotificationAdmin(self, user) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", None) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestAcceptedNotificationAdmin for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return WebcastRequestError('accept', e) manager = self._conf.getCSBookingManager() manager.notifyInfoChange() def _reject(self): self._statusMessage = "Request rejected by responsible"