Changeset 7404 for main/waeup.sirp/trunk


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

Rename sendMail method to be more precise and not confuse with the send_mail function.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
4 edited

Legend:

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

    r7402 r7404  
    226226                           'user_type', 'system').title()
    227227        sirp_utils = getUtility(ISIRPUtils)
    228         success = sirp_utils.sendMail(
     228        success = sirp_utils.sendContactForm(
    229229                fullname,email,
    230230                self.config.name_admin,self.config.email_admin,
     
    247247    def send(self, *args, **data):
    248248        sirp_utils = getUtility(ISIRPUtils)
    249         success = sirp_utils.sendMail(
     249        success = sirp_utils.sendContactForm(
    250250                data['fullname'],data['email_from'],
    251251                self.config.name_admin,self.config.email_admin,
     
    470470                           'user_type', 'system').title()
    471471        sirp_utils = getUtility(ISIRPUtils)
    472         success = sirp_utils.sendMail(
     472        success = sirp_utils.sendContactForm(
    473473                self.request.principal.title,email,
    474474                self.context.title,self.context.email,
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r7389 r7404  
    143143    """A collection of methods which are subject to customization.
    144144    """
    145     def sendMail(fullname,username,usertype,portal,body,email_from,email_to,subject):
     145    def sendContactForm(
     146          from_name,from_addr,rcpt_name,rcpt_addr,
     147          from_username,usertype,portal,body,subject):
    146148        """Send an email with data provided by forms.
    147149        """
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7403 r7404  
    392392                           'user_type', 'system').title()
    393393        sirp_utils = getUtility(ISIRPUtils)
    394         success = sirp_utils.sendMail(
     394        success = sirp_utils.sendContactForm(
    395395                self.request.principal.title,email,
    396396                self.context.display_fullname,self.context.email,
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/utils.py

    r7402 r7404  
    4141    from_addr = from_addr.encode('ascii')
    4242    rpct_addr = rcpt_addr.encode('ascii')
    43 
    4443    for body_charset in ['US-ASCII', 'ISO-8859-1', 'UTF-8']:
    4544        try:
    4645            body.encode(body_charset)
    4746        except UnicodeError:
    48             print "FAILED: ", body_charset, body
     47            #print "FAILED: ", body_charset, body
    4948            pass
    5049        else:
    5150            break
    52 
    5351    msg = MIMEText(body.encode(body_charset), 'plain', body_charset)
    5452    msg['From'] = formataddr((from_name, from_addr))
     
    7270    grok.implements(ISIRPUtils)
    7371
    74     def sendMail(self,from_name,from_addr,rcpt_name,rcpt_addr,
     72    def sendContactForm(self,from_name,from_addr,rcpt_name,rcpt_addr,
    7573                from_username,usertype,portal,body,subject):
    7674        """Send an email with data provided by forms.
Note: See TracChangeset for help on using the changeset viewer.