source: WAeUP_SRP/uniben/waeup_custom/mail2student.py @ 3253

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

move files into uniben's waeup_custom

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