[Zope] help with MailTemplates 1.0.0

Nicolas Georgakopoulos nicolasg at vtrip.net
Wed Oct 12 04:46:15 EDT 2005


Chris Withers wrote:

> Nicolas Georgakopoulos wrote:
>
>>> Whatever you have selected is resolving to a string instead of a 
>>> MailHost object :-S
>>
>>
>> I have selected a Zope mailhost object....
>
>
> Please explain exactly what you did, including how you create the 
> MailHost, the Mail Template and the Python Script, in detail...
>
> I just tried to reproduce this on a fresh Zope 2.8.1 instance and 
> couldn't...
>
> Using the first example, the mail rendered and sent just fine.
>
> I'm still far from convinced the thing you think is a MailHost object 
> is actually a MailHost object, did you perhaps delete or rename your 
> MailHost object?
>
> Chris
>
I make it work , the fist time I try to use it I had copied my Mailhost 
object from another folder and it wasn't working. I delete it and create 
another one with a different name. When I go to the MailTemplate object 
to chooses my new MailHost it was already selected but still not 
working. The problem was solved when I push the save button any way and 
it works ...

Trying to execute the attachment example , you forgot to put ' ' on the 
second mail address  line: mto=('to1 at example.com',to2 at example.com),
And to send the attachment I get another error:
 <strong>Error Type: Unauthorized</strong><br/>
  <strong>Error Value: You are not allowed to access 'add_file' in this 
context</strong><br/>

and the traceback:

Traceback (innermost last):
    Module ZPublisher.Publish, line 113, in publish
    Module ZPublisher.mapply, line 88, in mapply
    Module ZPublisher.Publish, line 40, in call_object
  Module Shared.DC.Scripts.Bindings, line 311, in __call__
  Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
  Module Products.PageTemplates.ZopePageTemplate, line 256, in _exec
  Module Products.PageTemplates.PageTemplate, line 102, in pt_render
     - <ZopePageTemplate at /AtestFordelete/tt>
    Module TAL.TALInterpreter, line 206, in __call__
    Module TAL.TALInterpreter, line 250, in interpret
    Module TAL.TALInterpreter, line 426, in do_optTag_tal
    Module TAL.TALInterpreter, line 411, in do_optTag
    Module TAL.TALInterpreter, line 406, in no_tag
    Module TAL.TALInterpreter, line 250, in interpret
    Module TAL.TALInterpreter, line 501, in do_insertText_tal
    Module Products.PageTemplates.TALES, line 227, in evaluateText
  Module Products.PageTemplates.TALES, line 221, in evaluate
     - URL: /AtestFordelete/tt
   - Line 12, Column 6
   - Expression: standard:'options/message'
   - Names:
        {'container': <Folder at /AtestFordelete>,
         'context': <Folder at /AtestFordelete>,
       'default': <Products.PageTemplates.TALES.Default instance at 0x01152AF8>,
         'here': <Folder at /AtestFordelete>,
       'loop': <Products.PageTemplates.TALES.SafeMapping object at 0x01FC2990>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x0112DD50>,
       'nothing': None,
         'options': {'args': ()},
       'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0x01FC2990>,
         'request': <HTTPRequest, URL=http://localhost:8080/AtestFordelete/tt>,
       'root': <Application at >,
         'template': <ZopePageTemplate at /AtestFordelete/tt>,
       'traverse_subpath': [],
       'user': admin}
  Module Products.PageTemplates.Expressions, line 183, in __call__
  Module Products.PageTemplates.Expressions, line 171, in _eval
  Module Products.PageTemplates.Expressions, line 127, in _eval
   - __traceback_info__: options
    Module Products.PageTemplates.Expressions, line 306, in restrictedTraverse
     - __traceback_info__: {'path': ['message'], 'TraversalRequestNameStack': []}
KeyError: 'message'

I had change all my security options in the folder that I'm using the example objects (checked all the boxes on the Manager colum).
Am I doing something wrong?

PS: The test mail I received on the first simple example,  the part  <a 
href=""tal:define="url root/absolute_url" tal:attributes="href url" 
tal:content="url"/> doesn't render right , it actually show in the body 
of my message mail  like -->  your interest in: <a 
href="http://localhost:8080" 
<http://localhost:8080/>>http://localhost:8080 <http://localhost:8080/></a>

Cheers..


More information about the Zope mailing list