Last change
on this file since 6964 was
1597,
checked in by joachim, 18 years ago
|
merged changes 1588:1596 from trunk to joachim-event-branch
|
File size:
1.4 KB
|
Rev | Line | |
---|
[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
|
---|
[1597] | 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 |
|
---|
| 12 | mhost = context.MailHost
|
---|
| 13 | prop = context.portal_properties
|
---|
| 14 |
|
---|
| 15 | # the message format, %s will be filled in from data
|
---|
| 16 |
|
---|
| 17 | message = """
|
---|
| 18 | From: %s <%s>
|
---|
| 19 | To: %s
|
---|
| 20 | Cc: %s
|
---|
| 21 | Bcc: %s
|
---|
| 22 | Reply-To: %s
|
---|
| 23 | Subject: %s
|
---|
| 24 | %s
|
---|
| 25 | """
|
---|
| 26 |
|
---|
| 27 | #prop.email_from_address should be used for To:
|
---|
[909] | 28 | REQUEST = context.REQUEST
|
---|
[1597] | 29 |
|
---|
| 30 | #url_tuple = REQUEST.HTTP_REFERER.split('?')
|
---|
| 31 | #if len(url_tuple) == 2:
|
---|
| 32 | # url_tuple[1] ='portal_status_message=Your message has been sent!'
|
---|
| 33 | #else:
|
---|
| 34 | # url_tuple.append('portal_status_message=Your message has been sent!')
|
---|
| 35 | #redirect_url = "?".join(url_tuple)
|
---|
| 36 | #REQUEST.set('rurl', redirect_url) # to see the result in the error log
|
---|
| 37 |
|
---|
[891] | 38 | msg = message % (
|
---|
| 39 | co_name,
|
---|
| 40 | co_email,
|
---|
[1596] | 41 | student_email,
|
---|
[891] | 42 | co_email,
|
---|
| 43 | 'henrik@waeup.org',
|
---|
| 44 | # 'js@aixtraware.de',
|
---|
| 45 | co_email,
|
---|
| 46 | probtype,
|
---|
| 47 | commt,
|
---|
| 48 | )
|
---|
| 49 | mhost.send(msg)
|
---|
| 50 |
|
---|
| 51 |
|
---|
[1597] | 52 | #REQUEST = context.REQUEST
|
---|
| 53 | #RESPONSE = REQUEST.RESPONSE
|
---|
| 54 | #RESPONSE.redirect(redirect_url)
|
---|
| 55 |
|
---|
| 56 | args = {}
|
---|
| 57 | psm = "Your message has been sent!"
|
---|
| 58 | args['portal_status_message'] = psm
|
---|
| 59 | url = context.absolute_url() + '/' + action + '?' + urlencode(args)
|
---|
| 60 | return REQUEST.RESPONSE.redirect(url)
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 |
|
---|
| 64 |
|
---|
Note: See
TracBrowser for help on using the repository browser.