Package com.avoka.fc.core.service
Interface IEmailService
- All Superinterfaces:
IServiceDefinitionAware
- All Known Implementing Classes:
AbstractEmailService
,EmailService
,ExchangeEmailService
,FluentEmailService
,GroovyEmailService
,SmtpEmailService
,TrashCanEmailService
Provides an Email Service interface.
- Since:
- 4.3.2
-
Method Summary
Modifier and TypeMethodDescriptiongetTemplatedEmailMessageForPortal
(Portal portal, String subject, String message) Return the HTML border templated email message for the given submission.getTemplatedEmailMessageForSubmission
(Submission submission, String subject, String message) Return the HTML border templated email message for the given submission.getTemplatedEmailMessageForSubmission
(Submission submission, String subject, String message, Portal portal) Return the HTML border templated email message for the given submission.void
queueAccountStatusNotification
(UserAccount userAccount, Portal portal) Create the account status notification on the email queue.queueEmail
(Portal portal, Submission submission, String from, String to, String subject, String body, String category) Create an email on the email queuequeueEmail
(Portal portal, Submission submission, String from, String to, String cc, String bcc, String replyTo, String subject, String body, String category, Map<String, byte[]> attachmentMap) Create an email on the email queue.queueEmail
(Portal portal, Submission submission, String from, String to, String cc, String replyTo, String subject, String body, String category, Map<String, byte[]> attachmentMap) Create an email on the email queue.queueEmail
(Portal portal, Submission submission, String from, String to, String replyTo, String subject, String body, String category, Map<String, byte[]> attachmentMap) Create an email on the email queuequeueEmail
(Portal portal, Submission submission, String from, String to, String subject, String body, String category, Map<String, byte[]> attachmentMap) Create an email on the email queueboolean
queueFormReceiptEmail
(Submission submission, String toAddress) Queue email for submission receipt to an address.boolean
queueFormReceiptEmail
(Submission submission, String toAddress, String ccAddress) Queue email for submission receipt to an address.boolean
queueFormReceiptEmail
(Submission submission, String toAddress, String ccAddress, String bccAddress) Queue email for submission receipt to an address.void
queueNewAccountNotification
(UserAccount userAccount, Portal portal) Create new account notification on the email queue.boolean
queueOrSendFormConfirmationReceiptMessage
(Submission submission, String toAddress) Deprecated.void
queuePromotionNotificationMessage
(String toAddress, String formName, String promotionLevelName, String clientName, String notes) Queue a promotion notification message to the to addressvoid
queueSavedFormEmail
(Submission submission, String formUrl, String toAddress) Queue email with a link to a saved submission to an anonymous uservoid
queueSavedFormEmail
(Submission submission, String formUrl, String toAddress, String ccAddress) Queue email with a link to a saved submission to an anonymous uservoid
queueSavedFormEmail
(Submission submission, String formUrl, String toAddress, String ccAddress, String bccAddress) Queue email with a link to a saved submission to an anonymous uservoid
queueShareFormEmail
(Submission submission, String senderName, String emailAddresses, String emailBody) Queue an email notifying people with whom a saved form has been shared.void
queueSubmissionUpdateNotification
(Submission submission, String emailSubject, String emailBody) Create the submission update notification on an email queue.void
queueTemplatedMessageForPortal
(String emailAddress, String subject, String messageContent, Map<String, Object> model, Portal portal) Queue the templated email message for specified portal.renderDeploymentPropertyTemplate
(String templateName, Map model) Render the named Deployment Property template value with the model using the Velocity engine.Send a duplicate payment alert email related to a payment log entry and return the sent email body message.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.void
sendEmailVerification
(Submission submission) Immediately send an submission verification email.void
sendEmailVerification
(String loginName, String emailAddress, String givenName, String familyName, String userKey, Portal portal) Immediately send an email verification email for a new user.void
sendFormConfirmationMessage
(Submission submission, String toAddress) Send a submission confirmation email to an address, which does not include a PDF receiptvoid
sendFormReceiptMessage
(Submission submission, String toAddress) Send a submission receipt to an address.sendFraudAlertEmailToClientAdmin
(PaymentLog paymentLog) Send a fraud alert email related to a payment log entry and return the sent email body message.void
sendLostPasswordMessage
(UserAccount userAccount, String loginURL, Portal portal) Reset a user's password and send the email to his/her email address.void
sendMessage
(String subject, String message, String from, String toAddress) Send an email message.void
sendMessage
(String subject, String message, String from, String toAddress, boolean backgroundThread) Send an email message, optionally using a background thread.void
Send an email messagevoid
sendMessage
(String subject, String message, String fromAddress, String replyToAddress, String toAddress, String ccAddress, String bccAddress, Map<String, byte[]> attachmentMap) Send an email message.void
sendMessage
(String subject, String message, String fromAddress, String toAddress, String ccAddress, Map<String, byte[]> attachmentMap) Send an email message.void
sendMessageWithSubmissionAttachments
(String subject, String message, String fromAddress, String toAddress, Map<String, DataDocument> deliveryAttachmentsMap) Send an email message with the provided submission delivery process attachments map.void
sendSavedFormEmail
(Submission submission, String formUrl, String toAddress) Send an email with a link to a saved submission to an anonymous uservoid
sendSavedFormEmail
(Submission submission, String formUrl, String toAddress, boolean backgroundThread) Send an email with a link to a saved submission to an anonymous userboolean
sendTaskNotification
(Submission submission) Send a task notification to a user or a group of users.void
sendTemplatedMessageForPortal
(String emailAddress, String subject, String messageContent, Map<String, Object> model, Portal portal) Send the templated email message for specified portal.void
sendWelcomeUserMessage
(UserAccount userAccount, Portal portal) Send a welcome message to the user.void
sendWelcomeUserMessage
(UserAccount userAccount, Portal portal, String tempPassword) Send a welcome message to the userMethods inherited from interface com.avoka.fc.core.service.IServiceDefinitionAware
getServiceDefinition, setServiceDefinition
-
Method Details
-
queueEmail
EmailQueue queueEmail(Portal portal, Submission submission, String from, String to, String subject, String body, String category) Create an email on the email queue Note that this method contains database transactions.- Parameters:
portal
- the portal objectsubmission
- the submission (optional, will be used to resolve IEmailService at send time if set)from
- from addressto
- to addresssubject
- the email subjectbody
- the email bodycategory
- the category of the email queue- Returns:
- the resulting email queue entry
-
queueEmail
EmailQueue queueEmail(Portal portal, Submission submission, 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.- Parameters:
portal
- the portal objectsubmission
- the submission (optional, will be used to resolve IEmailService at send time if set)from
- 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
-
queueEmail
EmailQueue queueEmail(Portal portal, Submission submission, String from, String to, String replyTo, String subject, String body, String category, Map<String, byte[]> attachmentMap) Create an email on the email queue Note that this method contains database transactions.- Parameters:
portal
- the portal objectsubmission
- the submission (optional, will be used to resolve IEmailService at send time if set)from
- from addressto
- to addressreplyTo
- the reply 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.3.4
-
queueEmail
EmailQueue queueEmail(Portal portal, Submission submission, String from, String to, String cc, String replyTo, String subject, String body, String category, Map<String, byte[]> attachmentMap) Create an email on the email queue. Note that this method contains database transactions.- Parameters:
portal
- the portal objectsubmission
- the submission (optional, will be used to resolve IEmailService at send time if set)from
- from addressto
- to addresscc
- cc addressreplyTo
- the reply 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:
- 18.15.0
-
queueEmail
EmailQueue queueEmail(Portal portal, Submission submission, String from, String to, String cc, String bcc, String replyTo, String subject, String body, String category, Map<String, byte[]> attachmentMap) Create an email on the email queue. Note that this method contains database transactions.- Parameters:
portal
- the portal objectsubmission
- the submission (optional, will be used to resolve IEmailService at send time if set)from
- from addressto
- to addresscc
- cc addressbcc
- bcc addressreplyTo
- the reply 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:
- 21.11.4
-
queueFormReceiptEmail
Queue email for submission receipt to an address.- Parameters:
submission
- a submission (required)toAddress
- an email address to send (required)- Returns:
- true if an email was queue, or false if not user email address was found
- Since:
- 5.1.0
-
queueFormReceiptEmail
Queue email for submission receipt to an address.- Parameters:
submission
- a submission (required)toAddress
- an email address to send (required)ccAddress
- email address to cc (optional)- Returns:
- true if an email was queue, or false if not user email address was found
- Since:
- 18.5.0
-
queueFormReceiptEmail
boolean queueFormReceiptEmail(Submission submission, String toAddress, String ccAddress, String bccAddress) Queue email for submission receipt to an address.- Parameters:
submission
- a submission (required)toAddress
- an email address to send (required)ccAddress
- email address to cc (optional)bccAddress
- email address to bcc (optional)- Returns:
- true if an email was queue, or false if not user email address was found
- Since:
- 21.11.4
-
queueTemplatedMessageForPortal
void queueTemplatedMessageForPortal(String emailAddress, String subject, String messageContent, Map<String, Object> model, Portal portal) Queue the templated email message for specified portal. The Portal Property "Email Template HTML" provides the email message body. Note that this method contains database transactions.- Parameters:
emailAddress
- the email address to send the email to (required)subject
- the email (required)messageContent
- the inner email message content (required)model
- the model to merge with the messageContent (required)portal
- the portal which provides the "Email Template HTML" property (required)
-
queueAccountStatusNotification
Create the account status notification on the email queue. Note that this method contains database transactions.- Parameters:
userAccount
- the user account (required)portal
- the user portal (required)
-
queueNewAccountNotification
Create new account notification on the email queue. Note that this method contains database transactions. Note that this method contains database transactions.- Parameters:
userAccount
- the user account (required)portal
- the user portal (required)
-
queuePromotionNotificationMessage
void queuePromotionNotificationMessage(String toAddress, String formName, String promotionLevelName, String clientName, String notes) Queue a promotion notification message to the to address Note that this method contains database transactions.- Parameters:
toAddress
- email to addressformName
- email from addresspromotionLevelName
- promotion level nameclientName
- a client namenotes
- some notes to be displayed in the message
-
queueSavedFormEmail
Queue email with a link to a saved submission to an anonymous user- Parameters:
submission
- the saved form submission (required)formUrl
- the return form link URL (required)toAddress
- the email address to send to (required)- Since:
- 5.1.0
-
queueSavedFormEmail
Queue email with a link to a saved submission to an anonymous user- Parameters:
submission
- the saved form submission (required)formUrl
- the return form link URL (required)toAddress
- the email address to send to (required)ccAddress
- email address to cc (optional)- Since:
- 18.5.0
-
queueSavedFormEmail
void queueSavedFormEmail(Submission submission, String formUrl, String toAddress, String ccAddress, String bccAddress) Queue email with a link to a saved submission to an anonymous user- Parameters:
submission
- the saved form submission (required)formUrl
- the return form link URL (required)toAddress
- the email address to send to (required)ccAddress
- email address to cc (optional)bccAddress
- email address to bcc (optional)- Since:
- 21.11.4
-
queueSubmissionUpdateNotification
void queueSubmissionUpdateNotification(Submission submission, String emailSubject, String emailBody) Create the submission update notification on an email queue. Note that this method contains database transactions.- Parameters:
submission
- a submission objectemailSubject
- email subjectemailBody
- email body
-
renderDeploymentPropertyTemplate
Render the named Deployment Property template value with the model using the Velocity engine.- Parameters:
templateName
- the template Deployment Property namemodel
- the model to render- Returns:
- the rendered template
-
sendEmailMessage
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 to which the email relates (optional)
-
sendMessage
void sendMessage(String subject, String message, String from, String toAddress, boolean backgroundThread) Send an email message, optionally using a background thread.- Parameters:
subject
- email subjectmessage
- email message bodyfrom
- email from addresstoAddress
- email to addressbackgroundThread
- send the email using a background thread
-
sendMessage
Send an email message.- Parameters:
subject
- email subjectmessage
- email message bodyfrom
- email from addresstoAddress
- email to address
-
sendMessage
Send an email message- Parameters:
subject
- email subjectmessage
- email message bodyfrom
- email from addresstoAddress
- email to addressccAddress
- email address to cc
-
sendMessage
void sendMessage(String subject, String message, String fromAddress, String toAddress, String ccAddress, Map<String, byte[]> attachmentMap) Send an email message.- Parameters:
subject
- email subjectmessage
- email message bodyfromAddress
- the from addresstoAddress
- email to addressccAddress
- email address to ccattachmentMap
- attachments map
-
sendMessage
void sendMessage(String subject, String message, String fromAddress, String replyToAddress, String toAddress, String ccAddress, String bccAddress, Map<String, byte[]> attachmentMap) 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 map
-
sendMessageWithSubmissionAttachments
void sendMessageWithSubmissionAttachments(String subject, String message, String fromAddress, String toAddress, Map<String, DataDocument> deliveryAttachmentsMap) Send an email message with the provided submission delivery process attachments map.- Parameters:
subject
- email subject (required)message
- email message body (required)fromAddress
- the from addresstoAddress
- email to address (required)deliveryAttachmentsMap
- submission delivery process attachments map (required)
-
queueOrSendFormConfirmationReceiptMessage
@Deprecated boolean queueOrSendFormConfirmationReceiptMessage(Submission submission, String toAddress) Deprecated.This can be used to queue an email to the user containing the receipt. Note: This method will use the contact email address, then try the user's email address. If neither is available, no email will be queued. This method will either use the Email Queue if a PDF receipt attachment must be generated for the email, or will execute the send email function in a new background thread so user thread is not blocked sending the email.- Parameters:
submission
- the submission (required)toAddress
- the send to email address- Returns:
- true if an email was queue, or false if not user email address was found
-
sendFormReceiptMessage
Send a submission receipt to an address.- Parameters:
submission
- a submission (required)toAddress
- an email address to send (required)
-
sendFormConfirmationMessage
Send a submission confirmation email to an address, which does not include a PDF receipt- Parameters:
submission
- a submission (required)toAddress
- an email address to send (required)
-
sendSavedFormEmail
Send an email with a link to a saved submission to an anonymous user- Parameters:
submission
- the saved form submission (required)formUrl
- the return form link URL (required)toAddress
- the email address to send to (required)
-
sendSavedFormEmail
void sendSavedFormEmail(Submission submission, String formUrl, String toAddress, boolean backgroundThread) Send an email with a link to a saved submission to an anonymous user- Parameters:
submission
- the saved form submission (required)formUrl
- the return form link URL (required)toAddress
- the email address to send to (required)backgroundThread
- send email in background thread
-
sendLostPasswordMessage
Reset a user's password and send the email to his/her email address. Note that this method contains database transactions.- Parameters:
userAccount
- the user account objectloginURL
- the URL for the user to change the passwordportal
- the portal which take the request
-
sendWelcomeUserMessage
Send a welcome message to the user. Note that a new temp password is generated for the user.- Parameters:
userAccount
- the user accountportal
- the portal instance- Since:
- 19.11.0
-
sendWelcomeUserMessage
Send a welcome message to the user- Parameters:
userAccount
- the user accountportal
- the portal instancetempPassword
- the user password
-
sendTaskNotification
Send a task notification to a user or a group of users.- Parameters:
submission
- the task submission (required)- Returns:
- true if at least one addressee was found.
-
sendEmailVerification
Immediately send an submission verification email.- Parameters:
submission
- the submission (required)
-
sendEmailVerification
void sendEmailVerification(String loginName, String emailAddress, String givenName, String familyName, String userKey, Portal portal) Immediately send an email verification email for a new user.- Parameters:
loginName
- the user's login name (required)emailAddress
- the user's email address (required)givenName
- the user's given name (required)familyName
- the user's family name (required)userKey
- the user's user key (required)portal
- the user portal (required)
-
sendDuplicatePaymentAlertEmailToClientAdmin
Send a duplicate payment alert email related to a payment log entry and return the sent email body message.- Parameters:
paymentLog
- the paymentLog to generate the context for (required)- Returns:
- the sent email body message
-
sendFraudAlertEmailToClientAdmin
Send a fraud alert email related to a payment log entry and return the sent email body message.- Parameters:
paymentLog
- the paymentLog to generate the context for (required)- Returns:
- the sent email body message
-
getTemplatedEmailMessageForSubmission
Return the HTML border templated email message for the given submission.- Parameters:
submission
- the form submissionsubject
- the email subject linemessage
- the email message content- Returns:
- HTML border templated email message
-
getTemplatedEmailMessageForSubmission
String getTemplatedEmailMessageForSubmission(Submission submission, String subject, String message, Portal portal) Return the HTML border templated email message for the given submission.- Parameters:
submission
- the form submissionsubject
- the email subject linemessage
- the email message contentportal
- the portal used to loookup the portal properties- Returns:
- HTML border templated email message
-
getTemplatedEmailMessageForPortal
Return the HTML border templated email message for the given submission.- Parameters:
portal
- the portal objectsubject
- the email subject linemessage
- the email message content- Returns:
- HTML border templated email message
-
sendTemplatedMessageForPortal
void sendTemplatedMessageForPortal(String emailAddress, String subject, String messageContent, Map<String, Object> model, Portal portal) Send the templated email message for specified portal. The Portal Property "Email Template HTML" provides the email message body.- Parameters:
emailAddress
- the email address to send the email to (required)subject
- the email (required)messageContent
- the inner email message content (required)model
- the model to merge with the messageContent (required)portal
- the portal which provides the "Email Template HTML" property (required)
-
queueFormReceiptEmail(Submission, String)
)