Changeset 7403 for main/waeup.sirp/trunk


Ignore:
Timestamp:
20 Dec 2011, 09:26:14 (13 years ago)
Author:
Henrik Bettermann
Message:

Do the same in students.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7386 r7403  
    385385    @grok.action('Send message now')
    386386    def send(self, *args, **data):
    387         fullname = self.request.principal.title
    388387        try:
    389             email_from = self.request.principal.email
     388            email = self.request.principal.email
    390389        except AttributeError:
    391             email_from = self.config.email_admin
    392         username = self.request.principal.id
    393         usertype = self.request.principal.user_type.title()
    394         body = data['body']
    395         #subject = u'Mail from SIRP'
    396         subject = data['subject']
    397         email_to = self.context.email
     390            email = self.config.email_admin
     391        usertype = getattr(self.request.principal,
     392                           'user_type', 'system').title()
    398393        sirp_utils = getUtility(ISIRPUtils)
    399         success = sirp_utils.sendMail(fullname,username,usertype,self.config.name,
    400                   body,email_from,email_to,subject)
     394        success = sirp_utils.sendMail(
     395                self.request.principal.title,email,
     396                self.context.display_fullname,self.context.email,
     397                self.request.principal.id,usertype,
     398                self.config.name,
     399                data['body'],data['subject'])
    401400        if success:
    402401            self.flash('Your message has been sent.')
Note: See TracChangeset for help on using the changeset viewer.