Exemple #1
0
    def _sendMessage(self, action, data):
        imsmessage = IIMSMessage(self.context)

        message = imsmessage.sendMessage(data['subject'], data['message'], data['receiver'])
        if message:
            IStatusMessage(self.request).addStatusMessage(_("Your message has been sent successfully"), type='info')
            return self.request.response.redirect(message.absolute_url())
        else:
            IStatusMessage(self.request).addStatusMessage(_("Sending your message failed"), type='error')
            return self.request.response.redirect(self.context.absolute_url())
Exemple #2
0
    def _sendMessage(self, action, data):
        imsmessage = IIMSMessage(self.context)

        message = imsmessage.sendMessage(data['subject'], data['message'], data['receiver'])
        if message:
            IStatusMessage(self.request).addStatusMessage(_(u"Your message has been sent successfully"), type='info')
            return self.request.response.redirect(message.absolute_url())
        else:
            IStatusMessage(self.request).addStatusMessage(_(u"Sending your message failed"), type='error')
            return self.request.response.redirect(self.context.absolute_url())
Exemple #3
0
def createMessageFolders(event):
    """ creates message-folders for the user
    """
    try:
        inst = getToolByName(event.principal, 'portal_quickinstaller')
    except:
        return
    if inst.isProductInstalled('IMS'):
        userid = event.principal.getId()
        ims = IIMSMessage(event.principal)
        ims._getMessageFolder(userid, 'received', 'ReceivedMessageFolder')
        ims._getMessageFolder(userid, 'sent', 'SentMessageFolder')
Exemple #4
0
def createMessageFolders(event):
    """ creates message-folders for the user
    """
    try:
        inst = getToolByName(event.principal, 'portal_quickinstaller')
    except:
        return
    if inst.isProductInstalled('IMS'):
        userid = event.principal.getId()
        ims = IIMSMessage(event.principal)
        ims._getMessageFolder(userid, 'received', 'ReceivedMessageFolder')
        ims._getMessageFolder(userid, 'sent', 'SentMessageFolder')
Exemple #5
0
 def forwardMessage(self, title, message, receiver):
     """ Forward this message to somebody
     """
     adapter = IIMSMessage(self)
     return adapter.forwardMessage(self, title, message, receiver)
Exemple #6
0
 def replyToMessage(self, title, message):
     """ Reply to this message
     """
     adapter = IIMSMessage(self)
     return adapter.replyToMessage(self, title, message)