[Zope] Email help
Colin Fox
cfox@cfconsulting.ca
20 Sep 2002 17:41:52 -0700
--=-eeXDmd0Kzco4C5VngVf9
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi, all.
I'm setting up a system where I need to be able to email an HTML report
upon demand to an arbitrary email address.
I found this script on the 'net, which looks to be just the thing I
need. However, I can't figure out how to invoke it.
I've attached the script (and it's called sendreport in my zope
installation), and here is the piece of python script that calls it:
context.sendreport(email='me@myemail.com', emailtype='1', \
reportid='summary', disclaimer_text='')
When I execute this, I get a key error on 'summary'. summary is a page
template (which requires no parameters) which builds an HTML page.
Am I missing something? How can I get this to work?
Thanks in advance,
Colin
--
Colin Fox cfox@cfconsulting.ca
CF Consulting Inc. GPG Fingerprint:
D8F0 84E7 E7CC 5C6C 9982 F1A7 A3EB 6EA3 BC97 572F
--=-eeXDmd0Kzco4C5VngVf9
Content-Disposition: attachment; filename=demo.txt
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=demo.txt; charset=ISO-8859-1
<dtml-sendmail mailhost=3D"MailHost">
To: <dtml-var email>
From: "Site Admin" <admin@whereever.com>
Subject: Your Report By Email
<dtml-if "emailtype=3D=3D'0'">
MIME-Version:1 .0
Content-Type: text/html; charset=3Dus-ascii
Content-Transfer-Encoding:7 bit
<dtml-var "_[reportid]">
Attached is the document you requested.
</dtml-if>
<dtml-if "emailtype=3D=3D'1'">
<dtml-mime type=3Dtext/plain encode=3D7bit>
Attached is the document you requested.
<dtml-var disclaimer_text>
<dtml-boundary name=3Dreport.htm type=3Dtext/html=20
disposition=3Dattachment encode=3D7bit><dtml-var "_[reportid]">
</dtml-mime>
</dtml-if>
<dtml-if "emailtype=3D=3D'2'">
<dtml-mime type=3Dtext/plain encode=3D7bit>
Attached is the document you requested.
<dtml-var disclaimer_text>
<dtml-boundary name=3Dreport.xls type=3Dapplication/msexcel=20
disposition=3Dattachment encode=3Dbase64><dtml-var "_[reportid]">
</dtml-mime>
</dtml-if>
</dtml-sendmail>
--=-eeXDmd0Kzco4C5VngVf9--