Re: [Zope] help with MailTemplates 1.0.0

2005-10-13 Thread Chris Withers

Nicolas Georgakopoulos wrote:
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. 


Yes, this is annoying and slightly confusing, I've made a note on the 
revelent issue:


https://secure.simplistix.co.uk/support/issue181

Trying to execute the attachment example , you forgot to put ' ' on the 
second mail address  line: mto=('[EMAIL PROTECTED]',[EMAIL PROTECTED]),


Oops, thanks for finding that, I've fixed that for the next release.


And to send the attachment I get another error:
strongError Type: Unauthorized/strongbr/
 strongError Value: You are not allowed to access 'add_file' in this 
context/strongbr/


The user executing the python script that calls add_file needs to have 
the 'Use mailhost services' permission, did they?
Shane Hathaway's VerboseSecurity product may help you figure out what's 
going on...


- __traceback_info__: {'path': ['message'], 
'TraversalRequestNameStack': []}

KeyError: 'message'


Yes, well, see my other reply about this...

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


Oops, another example corrected, the source should read:

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:
tal:x replace=root/absolute_url/

tal:x replace=options/message/

cheers,

The Web Team
/tal:body

cheers,

Chris - who does appreciate all the testing you're doing :-)

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-13 Thread Nicolas Georgakopoulos

Chris Withers wrote:


And to send the attachment I get another error:
strongError Type: Unauthorized/strongbr/
 strongError Value: You are not allowed to access 'add_file' in 
this context/strongbr/


The user executing the python script that calls add_file needs to have 
the 'Use mailhost services' permission, did they?
Shane Hathaway's VerboseSecurity product may help you figure out 
what's going on...


Why should I use this product? I'm a Manager user and I have permission 
in the current folder where the object's is to Use MailHost Services , 
Add Documents, Images, and Files 
http://localhost:8080/AtestFordelete/attachment_test/manage_permissionForm?permission_to_manage=Add%20Documents%2C%20Images%2C%20and%20Files 
and Change Images and Files 
http://localhost:8080/AtestFordelete/attachment_test/manage_permissionForm?permission_to_manage=Change%20Images%20and%20Files

I change the python script code to :
 
from email.MIMEBase import MIMEBase

msg=container.my_mt.as_message(
 mfrom='[EMAIL PROTECTED]',
 mto='[EMAIL PROTECTED]',
 message='This is a test!',
 subject='Attempt 100 !')
msg.send()

*have removed the -msg.add_file(container['myfile.bin']) and Zope 
prompts for user name and password. Whatever I write (correct login or 
not) it keeps prompting the same.

If  I choose cancel your product show me the current message:

strongError Type: Unauthorized/strongbr/
strongError Value: You are not allowed to access 'send' in this 
context/strongbr/


No error is reported in the error log...


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-12 Thread Nicolas Georgakopoulos

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=('[EMAIL PROTECTED]',[EMAIL PROTECTED]),

And to send the attachment I get another error:
strongError Type: Unauthorized/strongbr/
 strongError Value: You are not allowed to access 'add_file' in this 
context/strongbr/


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..
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Nicolas Georgakopoulos
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='[EMAIL PROTECTED]',
 mto='[EMAIL PROTECTED]',
 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 :


h2Site Error/h2

 pAn error was encountered while publishing this resource.
 /p
 
 p

 strongError Type: KeyError/strongbr/
 strongError Value: u'option'/strongbr/ 
 /p


can anyone give me a clue ?




___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Chris Withers

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
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Chris Withers

(for the 2nd time, please keep this on the list...)
(just for the light on thinking, that means hit reply all or make 
sure zope@zope.org is in the cc list)


Nicolas Georgakopoulos wrote:
Your documentation have anothe problem , you forgot to set a subject in 
your example :(


Oh dear, yes, I remember, I recently made subject required :-S
I'll have to fix that soon...


After I set a subject it say's :

strongError Type: AttributeError/strongbr/
strongError Value: 'str' object has no attribute '_send'/strongbr/
I don't know how to setup the _send attribute


Yes, and? Where's the rest of the traceback? I can't help you without it..

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Chris Withers

(sheesh, what is it with people, is 'reply all' that hard to find? ;-)

Tino Wildenhain wrote:

tal:x replace=options/message/


*yuck* tal to render plain text. Now thats ugly ;)


Suggest something better...

I find it convenient, especially for generating html mail, which 
customer have a habit of liking ;-)


On the development front, the fewer languages anyone needs to know to do 
development, the better. TAL/TALES works just as well here...


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Nicolas Georgakopoulos

Chris Withers wrote:


(for the 2nd time, please keep this on the list...)
(just for the light on thinking, that means hit reply all or make 
sure zope@zope.org is in the cc list)


Sorry for that , it was on purpose.. I'm new to Zope and thought that it 
wasn't right to bother the rest of the list with my beginner problem...



Nicolas Georgakopoulos wrote:

Your documentation have anothe problem , you forgot to set a subject 
in your example :(



Oh dear, yes, I remember, I recently made subject required :-S
I'll have to fix that soon...


After I set a subject it say's :

strongError Type: AttributeError/strongbr/
strongError Value: 'str' object has no attribute '_send'/strongbr/
I don't know how to setup the _send attribute



Yes, and? Where's the rest of the traceback? I can't help you without 
it..


cheers,

Chris


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.PythonScripts.PythonScript, line 323, in _exec
 Module None, line 1, in mailAction.py
  - PythonScript at /testFordelete/mailAction.py
  - Line 1
 Module Products.MailTemplates.BaseMailTemplate, line 117, in send
 Module Products.MailTemplates.BaseMailTemplate, line 107, in _send
AttributeError: 'str' object has no attribute '_send'

Thank's for your help, looking forward to test your product tomorrow ;) (don't 
have more time for today)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Chris Withers

Nicolas Georgakopoulos wrote:


Sorry for that , it was on purpose.. I'm new to Zope and thought that it 
wasn't right to bother the rest of the list with my beginner problem...


The opposite is true.. by keeping this on the list, not only can other 
people help out, but other people can learn, and this becomes a resource 
for others once archived by google and gmane ;-)



 Module Products.MailTemplates.BaseMailTemplate, line 117, in send
 Module Products.MailTemplates.BaseMailTemplate, line 107, in _send
AttributeError: 'str' object has no attribute '_send'


Hmmm, what have you selected in the MailHost drop-down on the Mail 
Template's edit page?


Whatever you have selected is resolving to a string instead of a 
MailHost object :-S


cheers,

Chris

PS: What Zope version are you using?

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Nicolas Georgakopoulos

Chris Withers wrote:


Nicolas Georgakopoulos wrote:



Sorry for that , it was on purpose.. I'm new to Zope and thought that 
it wasn't right to bother the rest of the list with my beginner 
problem...



The opposite is true.. by keeping this on the list, not only can other 
people help out, but other people can learn, and this becomes a 
resource for others once archived by google and gmane ;-)



 Module Products.MailTemplates.BaseMailTemplate, line 117, in send
 Module Products.MailTemplates.BaseMailTemplate, line 107, in _send
AttributeError: 'str' object has no attribute '_send'



Hmmm, what have you selected in the MailHost drop-down on the Mail 
Template's edit page?


Whatever you have selected is resolving to a string instead of a 
MailHost object :-S


I have selected a Zope mailhost object



cheers,

Chris

PS: What Zope version are you using?


Zope-2.8.1-final
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] help with MailTemplates 1.0.0

2005-10-11 Thread Chris Withers

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

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )