Class FreemarkerEmailFactory
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory
-
public class FreemarkerEmailFactory extends Object
A factory that creates Freemarker-based email messages. Client code should call isConfigured(), to be sure that the required email properties have been provided. If isConfigured() returns false, the client code should respond accordingly. On the other hand, if the configuration properties are provided, but are syntactically invalid, an exception is thrown and startup is aborted.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFreemarkerEmailFactory.BadPropertyValueExceptionstatic classFreemarkerEmailFactory.InvalidSmtpHoststatic classFreemarkerEmailFactory.NotConfiguredExceptionstatic classFreemarkerEmailFactory.SetupTries to create a FreemarkerEmailFactory bean and store it in the servlet context.static classFreemarkerEmailFactory.SmtpHostTesterChecks to see whether the SMTP host will talk to us.
-
Field Summary
Fields Modifier and Type Field Description static StringEMAIL_PASSWORDstatic StringEMAIL_PORTstatic StringEMAIL_USERNAMEstatic StringREPLY_TO_PROPERTYstatic StringSMTP_HOST_PROPERTY
-
Constructor Summary
Constructors Constructor Description FreemarkerEmailFactory(javax.servlet.ServletContext ctx)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FreemarkerEmailMessagecreateNewMessage(VitroRequest vreq)static javax.mail.SessiongetEmailSession(javax.servlet.http.HttpServletRequest req)Client code that does not use the FreemarkerEmailFactory can still use it's Email Session.static booleanisConfigured(javax.servlet.http.HttpServletRequest req)
-
-
-
Field Detail
-
SMTP_HOST_PROPERTY
public static final String SMTP_HOST_PROPERTY
- See Also:
- Constant Field Values
-
REPLY_TO_PROPERTY
public static final String REPLY_TO_PROPERTY
- See Also:
- Constant Field Values
-
EMAIL_PASSWORD
public static final String EMAIL_PASSWORD
- See Also:
- Constant Field Values
-
EMAIL_USERNAME
public static final String EMAIL_USERNAME
- See Also:
- Constant Field Values
-
EMAIL_PORT
public static final String EMAIL_PORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
createNewMessage
public static FreemarkerEmailMessage createNewMessage(VitroRequest vreq)
-
getEmailSession
public static javax.mail.Session getEmailSession(javax.servlet.http.HttpServletRequest req)
Client code that does not use the FreemarkerEmailFactory can still use it's Email Session.
-
isConfigured
public static boolean isConfigured(javax.servlet.http.HttpServletRequest req)
-
-