info.magnolia.module.mail
Class MgnlMailFactory

java.lang.Object
  extended by info.magnolia.module.mail.MgnlMailFactory

public class MgnlMailFactory
extends java.lang.Object

This reads the repository to know what kind of email to instantiate.

Author:
Nicolas Modrzyk

Constructor Summary
MgnlMailFactory()
          Use getInstance to get the current used instance.
 
Method Summary
 MgnlEmail getEmail(java.util.Map<java.lang.String,java.lang.Object> params)
          Creates email with no attachments.
 MgnlEmail getEmail(java.util.Map<java.lang.String,java.lang.Object> params, java.util.List<MailAttachment> attachments)
          Creates email with attachments.
protected  MgnlEmail getEmail(java.util.Map<java.lang.String,java.lang.Object> params, java.util.List<MailAttachment> attachments, MailTemplate template)
           
 MgnlEmail getEmailFromTemplate(java.lang.String id, java.util.List<MailAttachment> attachments, java.util.Map<java.lang.String,java.lang.Object> params)
          Creates email using predefined template.
 MgnlEmail getEmailFromTemplate(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params)
          Creates email using predefined template with no attachments.
protected  MgnlEmail getEmailFromType(MailTemplate template)
           
 MgnlEmail getEmailFromType(java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String type)
          Creates email with no attachments.
 MgnlEmail getEmailFromType(java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String type, java.util.List<MailAttachment> attachments)
          Creates email with attachments.
 MgnlEmail getEmailFromType(java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String type, java.lang.String contentType, java.util.List<MailAttachment> attachments)
           
 MgnlMailHandler getEmailHandler()
           
 java.util.Map<java.lang.String,java.lang.String> getRenderers()
           
protected  MailTemplate getTemplate(java.lang.String templateName)
           
 void setRenderers(java.util.Map<java.lang.String,java.lang.String> renderers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MgnlMailFactory

public MgnlMailFactory()
Use getInstance to get the current used instance.

Method Detail

getEmailHandler

public MgnlMailHandler getEmailHandler()

getEmail

public MgnlEmail getEmail(java.util.Map<java.lang.String,java.lang.Object> params)
Creates email with no attachments.


getEmailFromType

public MgnlEmail getEmailFromType(java.util.Map<java.lang.String,java.lang.Object> params,
                                  java.lang.String type)
Creates email with no attachments.


getEmailFromType

public MgnlEmail getEmailFromType(java.util.Map<java.lang.String,java.lang.Object> params,
                                  java.lang.String type,
                                  java.lang.String contentType,
                                  java.util.List<MailAttachment> attachments)

getEmailFromType

public MgnlEmail getEmailFromType(java.util.Map<java.lang.String,java.lang.Object> params,
                                  java.lang.String type,
                                  java.util.List<MailAttachment> attachments)
Creates email with attachments.


getEmail

public MgnlEmail getEmail(java.util.Map<java.lang.String,java.lang.Object> params,
                          java.util.List<MailAttachment> attachments)
Creates email with attachments.


getEmailFromTemplate

public MgnlEmail getEmailFromTemplate(java.lang.String id,
                                      java.util.List<MailAttachment> attachments,
                                      java.util.Map<java.lang.String,java.lang.Object> params)
                               throws java.lang.Exception
Creates email using predefined template.

Throws:
java.lang.Exception

getEmailFromTemplate

public MgnlEmail getEmailFromTemplate(java.lang.String id,
                                      java.util.Map<java.lang.String,java.lang.Object> params)
                               throws java.lang.Exception
Creates email using predefined template with no attachments.

Throws:
java.lang.Exception

getEmail

protected MgnlEmail getEmail(java.util.Map<java.lang.String,java.lang.Object> params,
                             java.util.List<MailAttachment> attachments,
                             MailTemplate template)

getEmailFromType

protected MgnlEmail getEmailFromType(MailTemplate template)
                              throws java.lang.Exception
Throws:
java.lang.Exception

getTemplate

protected MailTemplate getTemplate(java.lang.String templateName)
                            throws java.lang.Exception
Throws:
java.lang.Exception

getRenderers

public java.util.Map<java.lang.String,java.lang.String> getRenderers()

setRenderers

public void setRenderers(java.util.Map<java.lang.String,java.lang.String> renderers)


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