source: WAeUP_SRP/base/skins/waeup_student/mail2student.py @ 2353

Last change on this file since 2353 was 2316, checked in by Henrik Bettermann, 17 years ago

Some changes to make PRE-NCE application work.

mail2student.py: senders name and email address changed

File size: 1.1 KB
RevLine 
[891]1## Script (Python) "mail2student"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
[1595]7##parameters=co_name=None,co_email=None,student_email=None,probtype=None,commt=None, action=None
[891]8##title=
9##
10# $Id: mail2admin.py 869 2006-11-15 13:46:49Z henrik $
11
[1598]12from urllib import urlencode
13
[891]14mhost = context.MailHost
15prop = context.portal_properties
[2294]16REQUEST = context.REQUEST
[891]17
[2294]18d = {}
[2316]19#d['co_name'] = co_name
20#d['co_email'] = co_email
21d['co_name'] = 'CRPU Uniben'
22d['co_email'] = prop.email_from_address
[2294]23d['student_email'] = student_email
24d['probtype'] = probtype
25d['commt'] = commt
[1595]26
[2294]27message = """
28From: %(co_name)s <%(co_email)s>
29To: %(student_email)s
30Cc: %(co_email)s
31Reply-To: %(co_email)s
32Subject: %(probtype)s
33%(commt)s
34"""
[891]35
[2296]36mhost.send(message % d)
[891]37
[1595]38args = {}
39psm = "Your message has been sent!"
40args['portal_status_message'] = psm
[1608]41if action:
42    url = context.absolute_url() + '/' + action + '?' + urlencode(args)
43else:
44    url = context.absolute_url() +'?' + urlencode(args)
[2296]45return REQUEST.RESPONSE.redirect(url)
Note: See TracBrowser for help on using the repository browser.