jon         02/01/14 17:17:22

  Modified:    src/util/java/org/apache/fulcrum/template TemplateEmail.java
  Log:
  added methods to allow you to set a CC on an email...thanks to [EMAIL PROTECTED]
  for the patch
  
  -jon
  
  Revision  Changes    Path
  1.3       +23 -1     
jakarta-turbine-fulcrum/src/util/java/org/apache/fulcrum/template/TemplateEmail.java
  
  Index: TemplateEmail.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-fulcrum/src/util/java/org/apache/fulcrum/template/TemplateEmail.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TemplateEmail.java        13 Aug 2001 00:53:19 -0000      1.2
  +++ TemplateEmail.java        15 Jan 2002 01:17:22 -0000      1.3
  @@ -123,7 +123,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jon S. Stevens</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Greg Coladonato</a>
  - * @version $Id: TemplateEmail.java,v 1.2 2001/08/13 00:53:19 jon Exp $
  + * @version $Id: TemplateEmail.java,v 1.3 2002/01/15 01:17:22 jon Exp $
    */
   public class TemplateEmail
   {
  @@ -139,6 +139,12 @@
       /** The from email field. */
       private String fromEmail = null;
   
  +    /** The cc name field. */
  +    private String ccName = null;
  +
  +    /** The cc email field. */
  +    private String ccEmail = null;
  +
       /** The subject of the message. */
       private String subject = null;
   
  @@ -202,6 +208,21 @@
       }
   
       /**
  +     * CC: name, email.
  +     *
  +     * @param from A String with the CC name.
  +     * @param email A String with the CC email.
  +     * @return A TemplateEmail (self).
  +     */
  +    public TemplateEmail setCC(String cc,
  +                                 String email)
  +    {
  +        this.ccName = cc;
  +        this.ccEmail = email;
  +        return (this);
  +    }
  +
  +    /**
        * Subject.
        *
        * @param subject A String with the subject.
  @@ -287,6 +308,7 @@
           SimpleEmail se = new SimpleEmail();
           se.setFrom(fromEmail, fromName);
           se.addTo(toEmail, toName);
  +        se.addCc(ccEmail, ccName);
           se.setSubject(subject);
           se.setMsg(body);
           se.send();
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to