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
Modifier and TypeFieldDescriptionprotected FormDAO
The form DAOprotected AmetysObjectResolver
Ametys object resolver.static final String
Pattern for admin mailsstatic final String
Avalon ROLE. -
Constructor Summary
-
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 emailsvoid
service
(ServiceManager manager) 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:
service
in 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) 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 email- 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
-