Package org.ametys.web.workflow
Class SendMailFunction
java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
org.ametys.cms.workflow.AbstractContentWorkflowComponent
org.ametys.cms.workflow.SendMailFunction
org.ametys.web.workflow.SendMailFunction
- All Implemented Interfaces:
com.opensymphony.workflow.FunctionProvider
,EnhancedFunction
,PluginAware
,Initializable
,Contextualizable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
SendMailFunction
,SendMailToCreatorFunction
,SendMailToPersonInChargeFunction
,SendMailToUserFunction
OS workflow function to send mail after an action is triggered.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
AbstractWorkflowComponent.ConditionFailure
Nested classes/interfaces inherited from interface org.ametys.plugins.workflow.EnhancedFunction
EnhancedFunction.FunctionType
-
Field Summary
Fields inherited from class org.ametys.cms.workflow.SendMailFunction
_context, _i18nUtils, _pluginName, _rightManager, _rightsExtensionPoint, _sourceResolver, _userManager, _workflowProvider, BODY_KEY, RIGHTS_KEY, SEND_MAIL, SUBJECT_KEY
Fields inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
_contentHelper, CONTENT_KEY, HAS_CHANGED_KEY
Fields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_VALIDATION_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getContentUri
(WorkflowAwareContent content, Page page, Site site) Get the content uriprotected Page
_getPage
(WorkflowAwareContent content, Site site) Get the page referenced by this contentprotected Site
_getSite
(WorkflowAwareContent content) Get the site namegetBodyI18nParams
(User user, WorkflowAwareContent content) Get the i18n parameters of mail body textgetLabel()
Get the label for this functionprotected String
getMailBody
(String subjectI18nKey, String bodyI18nKey, User user, WorkflowAwareContent content, Map transientVars) Get the text body of mailgetSubjectI18nParams
(User user, WorkflowAwareContent content) Get the i18n parameters of mail subjectvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.cms.workflow.SendMailFunction
_getContentUri, _getRequest, _getRequestUri, _getUsers, _sendMails, contextualize, execute, getArguments, getCaller, getFullLabel, getFunctionExecType, getMailSubject, getRecipients, getSender, initialize, setPluginInfo
Methods inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
getContent
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.workflow.EnhancedFunction
getVisibilities
-
Constructor Details
-
SendMailFunction
public SendMailFunction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractContentWorkflowComponent
- Throws:
ServiceException
-
getSubjectI18nParams
Description copied from class:SendMailFunction
Get the i18n parameters of mail subject- Overrides:
getSubjectI18nParams
in classSendMailFunction
- Parameters:
user
- the callercontent
- the content- Returns:
- the i18n parameters
-
getMailBody
protected String getMailBody(String subjectI18nKey, String bodyI18nKey, User user, WorkflowAwareContent content, Map transientVars) throws IOException Description copied from class:SendMailFunction
Get the text body of mail- Overrides:
getMailBody
in classSendMailFunction
- Parameters:
subjectI18nKey
- the i18n key to use for body's titlebodyI18nKey
- the i18n key to use for bodyuser
- the callercontent
- the contenttransientVars
- the transient variables- Returns:
- the text body
- Throws:
IOException
- if an error occurred while building HTML workflow email
-
getBodyI18nParams
Description copied from class:SendMailFunction
Get the i18n parameters of mail body text- Overrides:
getBodyI18nParams
in classSendMailFunction
- Parameters:
user
- the callercontent
- the content- Returns:
- the i18n parameters
-
_getSite
Get the site name- Parameters:
content
- The content- Returns:
- the site name
-
_getPage
Get the page referenced by this content- Parameters:
content
- The contentsite
- the site- Returns:
- the page or null.
-
_getContentUri
Get the content uri- Parameters:
content
- the contentpage
- the referencing page. Can be null.site
- The site- Returns:
- the content uri
-
getLabel
Description copied from interface:EnhancedFunction
Get the label for this function- Specified by:
getLabel
in interfaceEnhancedFunction
- Overrides:
getLabel
in classSendMailFunction
- Returns:
- the label
-