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

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

fixed

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 = {}
19d['co_name'] = co_name
20d['co_email'] = co_email
21d['student_email'] = student_email
22d['probtype'] = probtype
23d['commt'] = commt
[1595]24
[2295]25#prop.email_from_address should be used for To:
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.