[Zope] sending a mail in a ZClass constructor

Jerome Alet alet@unice.fr
Fri, 27 Apr 2001 00:03:23 +0200


Hi,

I've got a MailHost in a Folder, which works fine when sending
emails with methods that are in this Folder.

Now I want to send an email every time someone creates 
a new instance of a particular ZClass, so I've tried to call
a method in the Folder in question in the MyClass_add DTML method
in my ZClass definition.

I've tried both <dtml-call "mymethod(_, REQUEST)">
and <dtml-call mymethod> but with no luck:

The problem is that the MailHost (called MailHost) is not found 
(KeyError), but mymethod is found, it seems.

FYI mymethod is just some DTML code containing a dtml-sendmail tag
and a message body, and works when launched directly in the Folder.

Does anyone have any idea ?

Thanks in advance

Jerome Alet