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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addContent
(javax.mail.internet.MimeMessage msg) protected void
addFromAddress
(javax.mail.internet.MimeMessage msg) protected void
addHeaders
(javax.mail.internet.MimeMessage msg) protected void
addRecipients
(javax.mail.internet.MimeMessage msg) protected void
addSubject
(javax.mail.internet.MimeMessage msg) protected javax.mail.Session
protected void
protected int
protected void
List<byte[]>
boolean
boolean
getEmail()
boolean
protected boolean
void
send()
protected void
protected boolean
sendIt
(javax.mail.Session mailSession, int smtpPortInt, javax.mail.internet.MimeMessage msg) void
setAttachmentNames
(List<String> attachmentNames) void
setAttachments
(List<byte[]> attachments) void
setBypassDatabase
(boolean bypassDatabase) void
setBypassSendGrid
(boolean bypassSendGrid) void
setCharacterEncoding
(String characterEncoding) void
void
setExtraHeaders
(Map<String, String> extraHeaders) void
setMailSessionProps
(Properties mailSessionProps) void
setMimeTypes
(List<String> mimeTypes) void
setSendInSeparateThread
(boolean sendInSeparateThread) void
setSmtpPassword
(String smtpPassword) void
setSmtpPort
(String smtpPort) void
setSmtpServer
(String smtpServer) void
setSmtpUsername
(String smtpUsername) protected boolean
protected boolean
updateEmailAfterSend
(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, utils
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
Methods 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:
getBypassDatabase
in interfaceEmailSender
-
setBypassDatabase
public void setBypassDatabase(boolean bypassDatabase) - Specified by:
setBypassDatabase
in interfaceEmailSender
-
getSendInSeparateThread
public boolean getSendInSeparateThread()- Specified by:
getSendInSeparateThread
in interfaceEmailSender
-
setSendInSeparateThread
public void setSendInSeparateThread(boolean sendInSeparateThread) - Specified by:
setSendInSeparateThread
in interfaceEmailSender
-
getBypassSendGrid
public boolean getBypassSendGrid()- Specified by:
getBypassSendGrid
in interfaceEmailSender
-
setBypassSendGrid
public void setBypassSendGrid(boolean bypassSendGrid) - Specified by:
setBypassSendGrid
in interfaceEmailSender
-
getEmail
- Specified by:
getEmail
in interfaceEmailSender
-
setEmail
- Specified by:
setEmail
in interfaceEmailSender
-
getSmtpServer
- Specified by:
getSmtpServer
in interfaceEmailSender
-
setSmtpServer
- Specified by:
setSmtpServer
in interfaceEmailSender
-
getSmtpUsername
- Specified by:
getSmtpUsername
in interfaceEmailSender
-
setSmtpUsername
- Specified by:
setSmtpUsername
in interfaceEmailSender
-
getSmtpPassword
- Specified by:
getSmtpPassword
in interfaceEmailSender
-
setSmtpPassword
- Specified by:
setSmtpPassword
in interfaceEmailSender
-
getSmtpPort
- Specified by:
getSmtpPort
in interfaceEmailSender
-
setSmtpPort
- Specified by:
setSmtpPort
in interfaceEmailSender
-
getMailSessionProps
- Specified by:
getMailSessionProps
in interfaceEmailSender
-
setMailSessionProps
- Specified by:
setMailSessionProps
in interfaceEmailSender
-
getExtraHeaders
- Specified by:
getExtraHeaders
in interfaceEmailSender
-
setExtraHeaders
- Specified by:
setExtraHeaders
in interfaceEmailSender
-
getCharacterEncoding
- Specified by:
getCharacterEncoding
in interfaceEmailSender
-
setCharacterEncoding
- Specified by:
setCharacterEncoding
in interfaceEmailSender
-
getAttachmentNames
- Specified by:
getAttachmentNames
in interfaceEmailSender
-
setAttachmentNames
- Specified by:
setAttachmentNames
in interfaceEmailSender
-
getAttachments
- Specified by:
getAttachments
in interfaceEmailSender
-
setAttachments
- Specified by:
setAttachments
in interfaceEmailSender
-
getMimeTypes
- Specified by:
getMimeTypes
in interfaceEmailSender
-
setMimeTypes
- Specified by:
setMimeTypes
in interfaceEmailSender
-
send
- Specified by:
send
in 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
-