Package org.ametys.plugins.forms.helper
Class FormAdminMailsHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.helper.FormAdminMailsHelper
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
The helper to handle admin emails
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FormDAOThe form DAOprotected AmetysObjectResolverAmetys object resolver.static final StringPattern for admin mailsstatic final StringAvalon ROLE. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAdminEmails(String formId) Get the entries admin emailsgetValidAdminEmails(String[] emailsTab) Check if an array of emails are valid and returns them without spacesremoveAdminEmails(String formId) Unset the properties relative to the admin emailsvoidservice(ServiceManager manager) setAdminEmails(String formId, String emails, String receiver, String subject, String body, String language) Get the entries admin emailsMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon ROLE. -
REGEX_MAIL
Pattern for admin mails- See Also:
-
_resolver
Ametys object resolver. -
_formDAO
The form DAO
-
-
Constructor Details
-
FormAdminMailsHelper
public FormAdminMailsHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getAdminEmails
Get the entries admin emails- Parameters:
formId- Id of the form- Returns:
- the map of admin emails
-
setAdminEmails
public Map<String,Object> setAdminEmails(String formId, String emails, String receiver, String subject, String body, String language) Get the entries admin emails- Parameters:
formId- Id of the formemails- mails of the adminreceiver- name of the form question to get receiver email from, can be nullsubject- subject of the admin emailbody- body of the admin emaillanguage- The language to use in the admin mail- Returns:
- the map of results
-
removeAdminEmails
Unset the properties relative to the admin emails- Parameters:
formId- The id ofthe current form- Returns:
- the map of results
-
getValidAdminEmails
Check if an array of emails are valid and returns them without spaces- Parameters:
emailsTab- the emails to check- Returns:
- the emails trimed or an empty list if they are not valids
-