[Zope] How do I implement Strip-o-gram or other solution?

Chris Abraham chrisabraham@yahoo.com
03 Sep 2002 15:05:15 -0400


Hi all:

I have an application that end up mailing a newly-created News Item to a
mailing list upon it being submitted.

The body text of this email is stored in HTML; I need to strip the HTML
tags from the content and render it as PLAINTEXT before sending it to
the MailHost and then off to the Mailing List.

I intalled the Strip-o-Gram product but cannot get it to work at all in
the way I expected it to work.

So, what I did was to create an External Method called html_to_text
which I set up like Module Name: stripogram.html_to_text and  Function
Name html_to_text.

Then, in my DTML Method that does the mailing, I have it set up so that
it is as follows:

<<
<dtml-with object_published>
<dtml-sendmail mailhost="MailHost">
To: email@address.com
From: <dtml-var from_user null="Some User <nobody@here.org>">
Subject: <dtml-var title>

<html>
<body>
<dtml-var "html_to_text(getHTMLBody)">
</body>
</html>

</dtml-sendmail>
</dtml-with>  
>>

If you were doing this simple thing, which is to say, taking the html
tags off of a tagged tract of text, rendering it as plaintext for an
email, what process or procedure would you use?

Cheers in advance,

Chris