help with MailTemplates 1.0.0
I installed the MailTemplates product to Zope and try to run the example from the readme file: -------------------------------------------------- Simple Example This example sends a simple templated mail to a specific address. Add the following to a Mail Template called my_mt: <tal:body xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:metal="http://xml.zope.org/namespaces/metal" >Dear <tal:x replace="options/mto"/>, <tal:x replace="user/getId"/> would like to thank you for your interest in: <a href="" tal:define="url root/absolute_url" tal:attributes="href url" tal:content="url"/> <tal:x replace="option/message"/> cheers, The Web Team </tal:body> Now add a Script (Python) in the same folder containing the following: container.my_mt( mfrom='webmaster@example.com', mto='user@example.com', message='This is a test!' ) return 'Mail Sent!' ------------------------------------------------------ I cant make it work, when I try to test the python script I get a page like this : <h2>Site Error</h2> <p>An error was encountered while publishing this resource. </p> <p> <strong>Error Type: KeyError</strong><br/> <strong>Error Value: u'option'</strong><br/> </p> can anyone give me a clue ?
Nicolas Georgakopoulos wrote:
I installed the MailTemplates product to Zope and try to run the example from the readme file: -------------------------------------------------- Simple Example This example sends a simple templated mail to a specific address. Add the following to a Mail Template called my_mt:
<tal:body xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:metal="http://xml.zope.org/namespaces/metal" >Dear <tal:x replace="options/mto"/>,
<tal:x replace="user/getId"/> would like to thank you for your interest in: <a href="" tal:define="url root/absolute_url" tal:attributes="href url" tal:content="url"/>
<tal:x replace="option/message"/>
d'oh, that's a typo ;-) <tal:x replace="options/message"/> I'll go and correct that in svn now :-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (2)
-
Chris Withers -
Nicolas Georgakopoulos