Last change
on this file since 844 was
830,
checked in by Henrik Bettermann, 18 years ago
|
redirect added
|
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Rev | Line | |
---|
[819] | 1 | ## Script (Python) "mail2admin"
|
---|
| 2 | ##bind container=container
|
---|
| 3 | ##bind context=context
|
---|
| 4 | ##bind namespace=
|
---|
| 5 | ##bind script=script
|
---|
| 6 | ##bind subpath=traverse_subpath
|
---|
[823] | 7 | ##parameters=fullname=None,regno=None,email=None,probtype=None,descr=None,commt=None
|
---|
[819] | 8 | ##title=
|
---|
| 9 | ##
|
---|
[830] | 10 | # $Id: mail2admin.py 830 2006-11-10 16:25:13Z henrik $
|
---|
[819] | 11 |
|
---|
| 12 | mhost = context.MailHost
|
---|
| 13 | prop = context.portal_properties
|
---|
| 14 |
|
---|
| 15 | # the message format, %s will be filled in from data
|
---|
[820] | 16 |
|
---|
[819] | 17 | message = """
|
---|
[822] | 18 | From: %s <%s>
|
---|
[819] | 19 | To: %s
|
---|
[830] | 20 | Bcc: %s
|
---|
[822] | 21 | Reply-To: %s
|
---|
[823] | 22 | Subject: WAeUP Contact Form
|
---|
[819] | 23 |
|
---|
[820] | 24 | Fullname: %s
|
---|
[825] | 25 | Member ID: %s
|
---|
[820] | 26 | Problem Type: %s
|
---|
| 27 | Description: %s
|
---|
| 28 | Comment: %s
|
---|
[819] | 29 | """
|
---|
| 30 |
|
---|
[822] | 31 | #prop.email_from_address should be used for To:
|
---|
| 32 |
|
---|
[819] | 33 | msg = message % (
|
---|
[822] | 34 | fullname,
|
---|
| 35 | email,
|
---|
[830] | 36 | prop.email_from_address,
|
---|
[820] | 37 | 'henrik@waeup.org',
|
---|
[830] | 38 | # 'js@aixtraware.de',
|
---|
[822] | 39 | email,
|
---|
[820] | 40 | fullname,
|
---|
[823] | 41 | regno,
|
---|
[820] | 42 | probtype,
|
---|
| 43 | descr,
|
---|
| 44 | commt,
|
---|
[819] | 45 | )
|
---|
[830] | 46 | mhost.send(msg)
|
---|
| 47 |
|
---|
| 48 | REQUEST = context.REQUEST
|
---|
| 49 | RESPONSE = REQUEST.RESPONSE
|
---|
| 50 |
|
---|
| 51 | redirect_url = REQUEST.HTTP_REFERER
|
---|
| 52 | redirect_url = '%s/?%s' % (redirect_url,'portal_status_message=Your message has been sent!')
|
---|
| 53 | RESPONSE.redirect(redirect_url)
|
---|
Note: See
TracBrowser for help on using the repository browser.