info.magnolia.module.mail
Class MgnlMailFactory

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

public class MgnlMailFactory
extends 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(Map<String,Object> params)
          Creates email with no attachments.
 MgnlEmail getEmail(Map<String,Object> params, List<MailAttachment> attachments)
          Creates email with attachments.
protected  MgnlEmail getEmail(Map<String,Object> params, List<MailAttachment> attachments, MailTemplate template)
           
 MgnlEmail getEmailFromTemplate(String id, List<MailAttachment> attachments, Map<String,Object> params)
          Creates email using predefined template.
 MgnlEmail getEmailFromTemplate(String id, Map<String,Object> params)
          Creates email using predefined template with no attachments.
protected  MgnlEmail getEmailFromType(MailTemplate template)
           
 MgnlEmail getEmailFromType(Map<String,Object> params, String type)
          Creates email with no attachments.
 MgnlEmail getEmailFromType(Map<String,Object> params, String type, List<MailAttachment> attachments)
          Creates email with attachments.
 MgnlEmail getEmailFromType(Map<String,Object> params, String type, String contentType, List<MailAttachment> attachments)
           
 MgnlMailHandler getEmailHandler()
           
 Map<String,String> getRenderers()
           
protected  MailTemplate getTemplate(String templateName)
           
 void setRenderers(Map<String,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(Map<String,Object> params)
Creates email with no attachments.


getEmailFromType

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


getEmailFromType

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

getEmailFromType

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


getEmail

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


getEmailFromTemplate

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

Throws:
Exception

getEmailFromTemplate

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

Throws:
Exception

getEmail

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

getEmailFromType

protected MgnlEmail getEmailFromType(MailTemplate template)
                              throws Exception
Throws:
Exception

getTemplate

protected MailTemplate getTemplate(String templateName)
                            throws Exception
Throws:
Exception

getRenderers

public Map<String,String> getRenderers()

setRenderers

public void setRenderers(Map<String,String> renderers)


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