source: WAeUP_SRP/branches/srpp_on_branch/skins/waeup_student/mail2student.py @ 17948

Last change on this file since 17948 was 909, checked in by joachim, 18 years ago

=redirect_url in mail2student corrected

File size: 1.2 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
8##title=
9##
10# $Id: mail2admin.py 869 2006-11-15 13:46:49Z henrik $
11
12mhost = context.MailHost
13prop = context.portal_properties
14
15# the message format, %s will be filled in from data
16
17message = """
18From: %s <%s>
19To: %s
20Cc: %s
21Bcc: %s
22Reply-To: %s
23Subject: %s
24%s
25"""
26
27#prop.email_from_address should be used for To:
28REQUEST = context.REQUEST
29url_tuple = REQUEST.HTTP_REFERER.split('?')
30if len(url_tuple) == 2:
31    url_tuple[1] ='portal_status_message=Your message has been sent!'
32else:
33    url_tuple.append('portal_status_message=Your message has been sent!')
34redirect_url = "?".join(url_tuple)
35REQUEST.set('rurl', redirect_url) # to see the result in the error log
36msg = message % (
37     co_name,
38     co_email,
39     student_email, 
40     co_email,
41     'henrik@waeup.org',
42#    'js@aixtraware.de',
43     co_email,
44     probtype,
45     commt,
46     )
47mhost.send(msg)
48
49REQUEST = context.REQUEST
50RESPONSE = REQUEST.RESPONSE
51
52RESPONSE.redirect(redirect_url)
Note: See TracBrowser for help on using the repository browser.