On Sun, May 07, 2000 at 06:39:20PM -0500, dave bryson wrote:
> On Sun, 07 May 2000, you wrote:
> > Hey all,
> > 
> > I just added a WebMacroEmail class that makes it easy to send an email who's
> > body is actually a processed WM template file! :-)
> Man, are you on a role or what!?

Indeed - it just gets better and better. This is just great, another job I can
ditch perl for :)

I'll be using this from Java code, and I'm sorry Jon but I can't stomach
writing 'toString' to send the email - just too obtuse :(

So can I respectfully suggest the attached patch, just adds a 'send' method
and has toString call that.

Cheers,

Sean


Index: WebMacroEmail.java
===================================================================
RCS file: 
/products/cvs/turbine/turbine/src/java/org/apache/turbine/util/webmacro/WebMacroEmail.java,v
retrieving revision 1.2
diff -r1.2 WebMacroEmail.java
102c102
<     wme.toString();
---
>     wme.send();
104,108c104,107
<     
<     The reason why the final call is to toString() is because WebMacro will
<     call this method on your object by default in the template system. Thus,
<     you need to call the toString() method from within your Java code to actually
<     send the email It does not actually return a result, just an empty String.
---
> 
>     (Note that when used within a WebMacro template, the send method will
>     be called for you when WebMacro tries to convert the WebMacroEmail
>     to a string by calling toString)
182c181
<     public String toString()
---
>     public void send()
203a203,210
>     }
>     /**
>      * toString() calls send() for ease of use within a WebMacro template
>      * (see example usage above)
>      */
>     public String toString()
>     {
>         send();


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to