Package com.avoka.fc.core.service.email
Class SmtpEmailService
java.lang.Object
com.avoka.fc.core.service.BaseService
com.avoka.fc.core.service.CayenneService
com.avoka.fc.core.service.email.AbstractEmailService
com.avoka.fc.core.service.email.SmtpEmailService
- All Implemented Interfaces:
IEmailService
,IServiceDefinitionAware
- Direct Known Subclasses:
EmailService
Provides an SMTP Email Service.
- Since:
- 4.3.2
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Provide an Email Format instance for use in Velocity templates.Nested classes/interfaces inherited from class com.avoka.fc.core.service.email.AbstractEmailService
AbstractEmailService.TempForm, AbstractEmailService.TempSubmission, AbstractEmailService.TempSubmissionExtractData, AbstractEmailService.TempUser
-
Field Summary
Fields inherited from class com.avoka.fc.core.service.email.AbstractEmailService
EMAIL_INFO_EVENT_LOG_PATTEN, serviceDefinition
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Return the email server connection timeout.int
Return the email server read timeout.int
Return the email server write timeout.Return the email sender address.Return the SMTP email server user password.Return the SMTP email server host name.int
Return the SMTP email server port number.Return the SMTP email server username.Return whether Checking is enabled for the server from the Socket connection against the server name(s) as expressed in the server certificate (RFC 2595 check) (mail.smtp.ssl.checkserveridentity).Return whether to start TLS email server connection (mail.smtp.starttls.enable).Return whether to use the global SMTP email settings.Create an email on the email queuequeueEmail
(Portal portal, String from, String to, String subject, String body, String category, Map<String, byte[]> attachmentMap) Create an email on the email queuevoid
sendEmailMessage
(String subject, String message, String fromAddress, String replyToAddress, String toAddress, String ccAddress, String bccAddress, Map<String, byte[]> attachmentMap, Submission submission) Send an email message.void
setConnectionTimeout
(int connectionTimeout) Set the email server connection timeout.void
setEmailReadTimeout
(int emailReadTimeout) Set the email server read timeout.void
setEmailWriteTimeout
(int emailWriteTimeout) Set the email server write timeout.void
setSenderEmailAddress
(String senderEmailAddress) Set the email sender address.void
setSmtpPassword
(String smtpPassword) Set the SMTP email server user password.void
setSmtpServerHost
(String smtpServerHost) Set the SMTP email server host name.void
setSmtpServerPort
(int smtpServerPort) Set the SMTP email server port number.void
setSmtpUser
(String smtpUser) Set the SMTP email server username.void
setSslCheckServerIdentity
(Boolean sslCheckServerIdentity) Determine whether Checking should be enabled for the server from the Socket connection against the server name(s) as expressed in the server certificate (RFC 2595 check) (mail.smtp.ssl.checkserveridentity).void
setStartTlsConnection
(Boolean startTlsConnection) Determine whether to start TLS email server connection (mail.smtp.starttls.enable).void
setUseGlobalSmtpSettings
(Boolean useGlobalSmtpSettings) Determine whether to use the global SMTP email settings.Methods inherited from class com.avoka.fc.core.service.email.AbstractEmailService
getServiceDefinition, getTemplatedEmailMessageForPortal, getTemplatedEmailMessageForSubmission, getTemplatedEmailMessageForSubmission, queueAccountStatusNotification, queueEmail, queueEmail, queueEmail, queueEmail, queueEmail, queueFormReceiptEmail, queueFormReceiptEmail, queueFormReceiptEmail, queueNewAccountNotification, queueOrSendFormConfirmationReceiptMessage, queuePromotionNotificationMessage, queueSavedFormEmail, queueSavedFormEmail, queueSavedFormEmail, queueShareFormEmail, queueSubmissionUpdateNotification, queueTemplatedMessageForPortal, renderDeploymentPropertyTemplate, sendDuplicatePaymentAlertEmailToClientAdmin, sendEmailVerification, sendEmailVerification, sendFormConfirmationMessage, sendFormReceiptMessage, sendFraudAlertEmailToClientAdmin, sendLostPasswordMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageWithSubmissionAttachments, sendSavedFormEmail, sendSavedFormEmail, sendTaskNotification, sendTemplatedMessageForPortal, sendWelcomeUserMessage, sendWelcomeUserMessage, setServiceDefinition
Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
Field Details
-
SERVICE_NAME
The SMTP Email Service definition name.- See Also:
-
-
Constructor Details
-
SmtpEmailService
public SmtpEmailService()
-
-
Method Details
-
getConnectionTimeout
public int getConnectionTimeout()Return the email server connection timeout.- Returns:
- the email server connection timeout in milliseconds
- Since:
- 23.10.0
-
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout) Set the email server connection timeout.- Parameters:
connectionTimeout
- the connection timeout value to be set
-
getEmailReadTimeout
public int getEmailReadTimeout()Return the email server read timeout.- Returns:
- the email server read timeout in milliseconds
- Since:
- 23.10.0
-
setEmailReadTimeout
public void setEmailReadTimeout(int emailReadTimeout) Set the email server read timeout.- Parameters:
emailReadTimeout
- the read timeout value to be set
-
getEmailWriteTimeout
public int getEmailWriteTimeout()Return the email server write timeout.- Returns:
- the email server write timeout in milliseconds
- Since:
- 23.10.0
-
setEmailWriteTimeout
public void setEmailWriteTimeout(int emailWriteTimeout) Set the email server write timeout.- Parameters:
emailWriteTimeout
- write timeout value to be set
-
getSenderEmailAddress
Return the email sender address.- Returns:
- the email sender address
- Since:
- 23.10.0
-
setSenderEmailAddress
Set the email sender address.- Parameters:
senderEmailAddress
- the email sender address to be set
-
getSmtpPassword
Return the SMTP email server user password.- Returns:
- email server user password
- Since:
- 23.10.0
-
setSmtpPassword
Set the SMTP email server user password.- Parameters:
smtpPassword
- the SMTP email server user password to be set
-
getSmtpServerHost
Return the SMTP email server host name.- Returns:
- the SMTP email server host name
- Since:
- 23.10.0
-
setSmtpServerHost
Set the SMTP email server host name.- Parameters:
smtpServerHost
- SMTP email server host name to be set
-
getSmtpServerPort
public int getSmtpServerPort()Return the SMTP email server port number.- Returns:
- the SMTP email server port number
- Since:
- 23.10.0
-
setSmtpServerPort
public void setSmtpServerPort(int smtpServerPort) Set the SMTP email server port number.- Parameters:
smtpServerPort
- the SMTP email server port number to be set
-
getSmtpUser
Return the SMTP email server username.- Returns:
- the SMTP email server username
- Since:
- 23.10.0
-
setSmtpUser
Set the SMTP email server username.- Parameters:
smtpUser
- the SMTP email server username to be set
-
isSslCheckServerIdentity
Return whether Checking is enabled for the server from the Socket connection against the server name(s) as expressed in the server certificate (RFC 2595 check) (mail.smtp.ssl.checkserveridentity).- Returns:
- true if the check is enabled
- Since:
- 23.10.0
-
setSslCheckServerIdentity
Determine whether Checking should be enabled for the server from the Socket connection against the server name(s) as expressed in the server certificate (RFC 2595 check) (mail.smtp.ssl.checkserveridentity).- Parameters:
sslCheckServerIdentity
- whether to enable the check
-
isStartTlsConnection
Return whether to start TLS email server connection (mail.smtp.starttls.enable).- Returns:
- true if the connection has started
- Since:
- 23.10.0
-
setStartTlsConnection
Determine whether to start TLS email server connection (mail.smtp.starttls.enable).- Parameters:
startTlsConnection
- whether to start the connection
-
isUseGlobalSmtpSettings
Return whether to use the global SMTP email settings.- Returns:
- true if global SMTP email settings should be used
- Since:
- 23.10.0
-
setUseGlobalSmtpSettings
Determine whether to use the global SMTP email settings.- Parameters:
useGlobalSmtpSettings
- whether to use the global SMTP email settings
-
sendEmailMessage
public void sendEmailMessage(String subject, String message, String fromAddress, String replyToAddress, String toAddress, String ccAddress, String bccAddress, Map<String, byte[]> attachmentMap, Submission submission) Send an email message.- Parameters:
subject
- email subjectmessage
- email message bodyfromAddress
- the from addressreplyToAddress
- the reply-to addresstoAddress
- email to addressccAddress
- email address to ccbccAddress
- email address to bccattachmentMap
- attachments mapsubmission
- the submission the email relates to (optional)
-
queueEmail
public EmailQueue queueEmail(Portal portal, String from, String to, String subject, String body, String category) Create an email on the email queue Note that this method contains database transactions. This method is provided for backwards compatibility.- Parameters:
portal
- the portal objectfrom
- from addressto
- to addresssubject
- the email subjectbody
- the email bodycategory
- the category of the email queue- Returns:
- the resulting email queue entry
-
queueEmail
public EmailQueue queueEmail(Portal portal, String from, String to, String subject, String body, String category, Map<String, byte[]> attachmentMap) Create an email on the email queue Note that this method contains database transactions. This method is provided for backwards compatibility.- Parameters:
portal
- the portal objectfrom
- from addressto
- to addresssubject
- the email subjectbody
- the email bodycategory
- the category of the email queueattachmentMap
- the map of attachments (optional)- Returns:
- the resulting email queue entry
- Since:
- 4.1.0
-