info.magnolia.module.mail.templates
Class MgnlEmail

java.lang.Object
  extended by javax.mail.Message
      extended by javax.mail.internet.MimeMessage
          extended by info.magnolia.module.mail.templates.MgnlEmail
All Implemented Interfaces:
javax.mail.internet.MimePart, javax.mail.Part
Direct Known Subclasses:
MgnlMultipartEmail

public abstract class MgnlEmail
extends javax.mail.internet.MimeMessage

Base class to send emails using Magnolia. Date: Mar 30, 2006 Time: 1:01:37 PM

Author:
Nicolas Modrzyk

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
javax.mail.internet.MimeMessage.RecipientType
 
Field Summary
protected static java.lang.String CHARSET_HEADER_STRING
           
protected static java.lang.String CONTENT_TYPE
           
protected static java.util.regex.Pattern EMAIL_WITH_PERSONAL_PATTERN
           
static org.slf4j.Logger log
           
protected static java.lang.String TEXT_HTML_UTF
           
protected static java.lang.String TEXT_PLAIN_UTF
           
 
Fields inherited from class javax.mail.internet.MimeMessage
content, contentStream, dh, flags, headers, modified, saved
 
Fields inherited from class javax.mail.Message
expunged, folder, msgnum, session
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
MgnlEmail(MailTemplate template)
           
 
Method Summary
 javax.mail.internet.MimeBodyPart addAttachment(MailAttachment attachment)
           
 java.lang.String getContentType()
           
 MailTemplate getTemplate()
           
 boolean isBodyNotSetFlag()
           
 void setAttachments(java.util.List<MailAttachment> list)
           
 void setBccList(java.lang.String list)
           
 void setBody()
           
abstract  void setBody(java.lang.String text)
           
 void setBodyFromResourceFile()
           
 void setBodyNotSetFlag(boolean _bodyNotSetFlag)
           
 void setCcList(java.lang.String list)
           
 void setCharsetHeader(java.lang.String charset)
           
 void setFrom(java.lang.String _from)
           
 void setReplyToList(java.lang.String list)
           
 void setSubject(java.lang.String arg0)
           
 void setTemplate(MailTemplate template)
           
 void setToList(java.lang.String list)
           
 
Methods inherited from class javax.mail.internet.MimeMessage
addFrom, addHeader, addHeaderLine, addRecipients, addRecipients, createInternetHeaders, createMimeMessage, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSize, getSubject, isMimeType, isSet, parse, removeHeader, reply, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFlags, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeTo, writeTo
 
Methods inherited from class javax.mail.Message
addRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_TYPE

protected static final java.lang.String CONTENT_TYPE
See Also:
Constant Field Values

TEXT_PLAIN_UTF

protected static final java.lang.String TEXT_PLAIN_UTF
See Also:
Constant Field Values

TEXT_HTML_UTF

protected static final java.lang.String TEXT_HTML_UTF
See Also:
Constant Field Values

CHARSET_HEADER_STRING

protected static final java.lang.String CHARSET_HEADER_STRING
See Also:
Constant Field Values

EMAIL_WITH_PERSONAL_PATTERN

protected static final java.util.regex.Pattern EMAIL_WITH_PERSONAL_PATTERN

log

public static org.slf4j.Logger log
Constructor Detail

MgnlEmail

public MgnlEmail(MailTemplate template)
Method Detail

setBody

public abstract void setBody(java.lang.String text)
                      throws java.lang.Exception
Throws:
java.lang.Exception

setSubject

public void setSubject(java.lang.String arg0)
                throws javax.mail.MessagingException
Overrides:
setSubject in class javax.mail.internet.MimeMessage
Throws:
javax.mail.MessagingException

isBodyNotSetFlag

public boolean isBodyNotSetFlag()

setBodyNotSetFlag

public void setBodyNotSetFlag(boolean _bodyNotSetFlag)

setTemplate

public void setTemplate(MailTemplate template)

getTemplate

public MailTemplate getTemplate()

setFrom

public void setFrom(java.lang.String _from)

setCharsetHeader

public void setCharsetHeader(java.lang.String charset)
                      throws MailException
Throws:
MailException

setToList

public void setToList(java.lang.String list)
               throws java.lang.Exception
Throws:
java.lang.Exception

setCcList

public void setCcList(java.lang.String list)
               throws java.lang.Exception
Throws:
java.lang.Exception

setBccList

public void setBccList(java.lang.String list)
                throws java.lang.Exception
Throws:
java.lang.Exception

setReplyToList

public void setReplyToList(java.lang.String list)
                    throws java.lang.Exception
Throws:
java.lang.Exception

setAttachments

public void setAttachments(java.util.List<MailAttachment> list)
                    throws MailException
Throws:
MailException

addAttachment

public javax.mail.internet.MimeBodyPart addAttachment(MailAttachment attachment)
                                               throws MailException
Throws:
MailException

setBodyFromResourceFile

public void setBodyFromResourceFile()
                             throws java.lang.Exception
Throws:
java.lang.Exception

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface javax.mail.Part
Overrides:
getContentType in class javax.mail.internet.MimeMessage

setBody

public void setBody()
             throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.