Class EmailSenderImpl
java.lang.Object
com.softslate.commerce.businessobjects.core.BaseBusinessObject
com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
com.softslate.commerce.businessobjects.email.EmailSenderImpl
- All Implemented Interfaces:
BusinessObject,BusinessProcessor,EmailSender
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddContent(javax.mail.internet.MimeMessage msg) protected voidaddFromAddress(javax.mail.internet.MimeMessage msg) protected voidaddHeaders(javax.mail.internet.MimeMessage msg) protected voidaddRecipients(javax.mail.internet.MimeMessage msg) protected voidaddSubject(javax.mail.internet.MimeMessage msg) protected javax.mail.Sessionprotected voidprotected intprotected voidList<byte[]>booleanbooleangetEmail()booleanprotected booleanvoidsend()protected voidprotected booleansendIt(javax.mail.Session mailSession, int smtpPortInt, javax.mail.internet.MimeMessage msg) voidsetAttachmentNames(List<String> attachmentNames) voidsetAttachments(List<byte[]> attachments) voidsetBypassDatabase(boolean bypassDatabase) voidsetBypassSendGrid(boolean bypassSendGrid) voidsetCharacterEncoding(String characterEncoding) voidvoidsetExtraHeaders(Map<String, String> extraHeaders) voidsetMailSessionProps(Properties mailSessionProps) voidsetMimeTypes(List<String> mimeTypes) voidsetSendInSeparateThread(boolean sendInSeparateThread) voidsetSmtpPassword(String smtpPassword) voidsetSmtpPort(String smtpPort) voidsetSmtpServer(String smtpServer) voidsetSmtpUsername(String smtpUsername) protected booleanprotected booleanupdateEmailAfterSend(boolean successful) Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getProductIDs, getSettings, getUser, initialize, isProcessorClassActive, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPGet, sendHTTPPost, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, updateOrderTotals, updateOrderTotals, updateOrderTotals, utilsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initializeMethods inherited from interface com.softslate.commerce.businessobjects.core.BusinessProcessor
getAppComponents, getAppSettings, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getSettings, getUser, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, utils
-
Field Details
-
log
static org.apache.commons.logging.Log log -
email
-
smtpServer
-
smtpUsername
-
smtpPassword
-
smtpPort
-
mailSessionProps
-
extraHeaders
-
characterEncoding
-
attachmentNames
-
attachments
-
mimeTypes
-
bypassSendGrid
private boolean bypassSendGrid -
bypassDatabase
private boolean bypassDatabase -
sendInSeparateThread
private boolean sendInSeparateThread
-
-
Constructor Details
-
EmailSenderImpl
public EmailSenderImpl()
-
-
Method Details
-
getBypassDatabase
public boolean getBypassDatabase()- Specified by:
getBypassDatabasein interfaceEmailSender
-
setBypassDatabase
public void setBypassDatabase(boolean bypassDatabase) - Specified by:
setBypassDatabasein interfaceEmailSender
-
getSendInSeparateThread
public boolean getSendInSeparateThread()- Specified by:
getSendInSeparateThreadin interfaceEmailSender
-
setSendInSeparateThread
public void setSendInSeparateThread(boolean sendInSeparateThread) - Specified by:
setSendInSeparateThreadin interfaceEmailSender
-
getBypassSendGrid
public boolean getBypassSendGrid()- Specified by:
getBypassSendGridin interfaceEmailSender
-
setBypassSendGrid
public void setBypassSendGrid(boolean bypassSendGrid) - Specified by:
setBypassSendGridin interfaceEmailSender
-
getEmail
- Specified by:
getEmailin interfaceEmailSender
-
setEmail
- Specified by:
setEmailin interfaceEmailSender
-
getSmtpServer
- Specified by:
getSmtpServerin interfaceEmailSender
-
setSmtpServer
- Specified by:
setSmtpServerin interfaceEmailSender
-
getSmtpUsername
- Specified by:
getSmtpUsernamein interfaceEmailSender
-
setSmtpUsername
- Specified by:
setSmtpUsernamein interfaceEmailSender
-
getSmtpPassword
- Specified by:
getSmtpPasswordin interfaceEmailSender
-
setSmtpPassword
- Specified by:
setSmtpPasswordin interfaceEmailSender
-
getSmtpPort
- Specified by:
getSmtpPortin interfaceEmailSender
-
setSmtpPort
- Specified by:
setSmtpPortin interfaceEmailSender
-
getMailSessionProps
- Specified by:
getMailSessionPropsin interfaceEmailSender
-
setMailSessionProps
- Specified by:
setMailSessionPropsin interfaceEmailSender
-
getExtraHeaders
- Specified by:
getExtraHeadersin interfaceEmailSender
-
setExtraHeaders
- Specified by:
setExtraHeadersin interfaceEmailSender
-
getCharacterEncoding
- Specified by:
getCharacterEncodingin interfaceEmailSender
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfaceEmailSender
-
getAttachmentNames
- Specified by:
getAttachmentNamesin interfaceEmailSender
-
setAttachmentNames
- Specified by:
setAttachmentNamesin interfaceEmailSender
-
getAttachments
- Specified by:
getAttachmentsin interfaceEmailSender
-
setAttachments
- Specified by:
setAttachmentsin interfaceEmailSender
-
getMimeTypes
- Specified by:
getMimeTypesin interfaceEmailSender
-
setMimeTypes
- Specified by:
setMimeTypesin interfaceEmailSender
-
send
- Specified by:
sendin interfaceEmailSender- Throws:
Exception
-
sendEmail
- Throws:
Exception
-
skipEmail
- Throws:
Exception
-
defineMailSessionProps
protected void defineMailSessionProps() -
createMailSession
protected javax.mail.Session createMailSession() -
findSmtpServerAndInfo
protected void findSmtpServerAndInfo() -
insertEmailBeforeSend
- Throws:
Exception
-
addHeaders
- Throws:
Exception
-
addRecipients
- Throws:
Exception
-
addFromAddress
- Throws:
Exception
-
addSubject
protected void addSubject(javax.mail.internet.MimeMessage msg) throws javax.mail.MessagingException - Throws:
javax.mail.MessagingException
-
addContent
protected void addContent(javax.mail.internet.MimeMessage msg) throws javax.mail.MessagingException - Throws:
javax.mail.MessagingException
-
defineSmtpPort
protected int defineSmtpPort() -
sendIt
protected boolean sendIt(javax.mail.Session mailSession, int smtpPortInt, javax.mail.internet.MimeMessage msg) -
updateEmailAfterSend
- Throws:
Exception
-