Changeset 7404 for main/waeup.sirp/trunk/src
- Timestamp:
- 20 Dec 2011, 09:33:10 (13 years ago)
- 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 226 226 'user_type', 'system').title() 227 227 sirp_utils = getUtility(ISIRPUtils) 228 success = sirp_utils.send Mail(228 success = sirp_utils.sendContactForm( 229 229 fullname,email, 230 230 self.config.name_admin,self.config.email_admin, … … 247 247 def send(self, *args, **data): 248 248 sirp_utils = getUtility(ISIRPUtils) 249 success = sirp_utils.send Mail(249 success = sirp_utils.sendContactForm( 250 250 data['fullname'],data['email_from'], 251 251 self.config.name_admin,self.config.email_admin, … … 470 470 'user_type', 'system').title() 471 471 sirp_utils = getUtility(ISIRPUtils) 472 success = sirp_utils.send Mail(472 success = sirp_utils.sendContactForm( 473 473 self.request.principal.title,email, 474 474 self.context.title,self.context.email, -
main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
r7389 r7404 143 143 """A collection of methods which are subject to customization. 144 144 """ 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): 146 148 """Send an email with data provided by forms. 147 149 """ -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7403 r7404 392 392 'user_type', 'system').title() 393 393 sirp_utils = getUtility(ISIRPUtils) 394 success = sirp_utils.send Mail(394 success = sirp_utils.sendContactForm( 395 395 self.request.principal.title,email, 396 396 self.context.display_fullname,self.context.email, -
main/waeup.sirp/trunk/src/waeup/sirp/utils/utils.py
r7402 r7404 41 41 from_addr = from_addr.encode('ascii') 42 42 rpct_addr = rcpt_addr.encode('ascii') 43 44 43 for body_charset in ['US-ASCII', 'ISO-8859-1', 'UTF-8']: 45 44 try: 46 45 body.encode(body_charset) 47 46 except UnicodeError: 48 print "FAILED: ", body_charset, body47 #print "FAILED: ", body_charset, body 49 48 pass 50 49 else: 51 50 break 52 53 51 msg = MIMEText(body.encode(body_charset), 'plain', body_charset) 54 52 msg['From'] = formataddr((from_name, from_addr)) … … 72 70 grok.implements(ISIRPUtils) 73 71 74 def send Mail(self,from_name,from_addr,rcpt_name,rcpt_addr,72 def sendContactForm(self,from_name,from_addr,rcpt_name,rcpt_addr, 75 73 from_username,usertype,portal,body,subject): 76 74 """Send an email with data provided by forms.
Note: See TracChangeset for help on using the changeset viewer.