Package com.avoka.fc.core.service.fluent
Class FluentEmailService
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.fluent.FluentEmailService
- All Implemented Interfaces:
IFluentService
,IEmailService
,IServiceDefinitionAware
,IUnitTestableService
Provides a Fluent API Groovy Email service.
- Since:
- 5.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.avoka.fc.core.service.email.AbstractEmailService
AbstractEmailService.EmailFormat, 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
Fields inherited from interface com.avoka.fc.core.service.fluent.IFluentService
PARAM_ACTION_PROPERTIES, PARAMS_FILEDATA, PARAMS_FILENAME, PARAMS_FORM, PARAMS_FORM_XML, PARAMS_FUNC_PARAM, PARAMS_JOB, PARAMS_JOB_ACTION, PARAMS_PARAMS, PARAMS_REQUEST, PARAMS_ROWS, PARAMS_SVC_DEF, PARAMS_TEST_PARAMS, PARAMS_TXN, PARAMS_USER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the GroovyScript execution timeout in milliseconds.Return the GroovyServiceLog record created after executing the script.Return the service definitionReturn the service Unit Test Script logger output.Invoke the Fluent Service using the given parameters.Return true if GroovyLogger DEBUG level message recording is enabled.boolean
Return true if the Groovy Service logging is enabled.Run the service's Unit Test Script if defined for the service, returning null if succeeded or an error if it failed.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
setExecutionTimeout
(Integer timeout) Return the GroovyScript execution timeout in milliseconds.void
setGroovyDebugLogging
(Boolean debugEnabled) Set whether GroovyLogger DEBUG level message recording is enabled.void
setGroovyLoggingEnabled
(Boolean loggingEnabled) Specify whether the Groovy Service logging is enabled.void
setGroovyScript
(String script) void
Set the service logger.void
setServiceDefinition
(ServiceDefinition serviceDefinition) Set the service definition.Methods inherited from class com.avoka.fc.core.service.email.AbstractEmailService
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
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
-
Constructor Details
-
FluentEmailService
public FluentEmailService()
-
-
Method Details
-
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.- Specified by:
sendEmailMessage
in interfaceIEmailService
- 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)- See Also:
-
invoke
Invoke the Fluent Service using the given parameters.- Specified by:
invoke
in interfaceIFluentService
- Parameters:
parameters
- the service script parameters (required)- Returns:
- a new invocation result
- See Also:
-
getErrorType
- Specified by:
getErrorType
in interfaceIFluentService
- Returns:
- the service error type to be used to classify the error logging records
- See Also:
-
runUnitTest
Run the service's Unit Test Script if defined for the service, returning null if succeeded or an error if it failed. If there is no 'Unit Test Script' defined, this method will return null.- Specified by:
runUnitTest
in interfaceIUnitTestableService
- Returns:
- an Exception if the test case failed, or null if the test case succeeded or no 'Unit Test Script' defined.
- See Also:
-
getTestLogOutput
Return the service Unit Test Script logger output.- Specified by:
getTestLogOutput
in interfaceIUnitTestableService
- Returns:
- the service Unit Test Script logger output
- Since:
- 17.10.0
- See Also:
-
getGroovyServiceLog
Return the GroovyServiceLog record created after executing the script.- Returns:
- the GroovyServiceLog record created after executing the script.
-
isGroovyDebugLogging
Return true if GroovyLogger DEBUG level message recording is enabled.- Returns:
- true if GroovyLogger DEBUG level message recording is enabled.
-
setGroovyDebugLogging
Set whether GroovyLogger DEBUG level message recording is enabled.- Parameters:
debugEnabled
- the groovyDebugLoggingEnabled to set
-
isGroovyLoggingEnabled
public boolean isGroovyLoggingEnabled()Return true if the Groovy Service logging is enabled.- Returns:
- true if the Groovy Service logging is enabled.
-
setGroovyLoggingEnabled
Specify whether the Groovy Service logging is enabled.- Parameters:
loggingEnabled
- specify whether the Groovy Service logging is enabled
-
getGroovyScript
- Returns:
- the Groovy Script content to execute
-
setGroovyScript
- Parameters:
script
- the Groovy Script content to execute
-
getExecutionTimeout
Return the GroovyScript execution timeout in milliseconds.- Returns:
- the GroovyScript execution timeout in milliseconds
-
setExecutionTimeout
Return the GroovyScript execution timeout in milliseconds.- Parameters:
timeout
- the GroovyScript execution timeout in milliseconds
-
getServiceDefinition
Return the service definition- Specified by:
getServiceDefinition
in interfaceIServiceDefinitionAware
- Overrides:
getServiceDefinition
in classAbstractEmailService
- Returns:
- the service definition.
-
setServiceDefinition
Set the service definition.- Specified by:
setServiceDefinition
in interfaceIServiceDefinitionAware
- Overrides:
setServiceDefinition
in classAbstractEmailService
- Parameters:
serviceDefinition
- the service definition to set
-
setLogger
Set the service logger.- Specified by:
setLogger
in interfaceIFluentService
- Parameters:
logger
- the service logger- Since:
- 17.10.0
- See Also:
-