Details
-
Improvement
-
Resolution: Fixed
-
Major
-
6.4
-
None
Description
Need:
- Ability to send a mail to a list of users in several groups
- Ability to also mention a discrete list of users to send to
- Ability to specify a discrete list of emails to sent to
- Ability to also exclude some users, some users and some emails
- Duplicate mails should not be sent to the same user
Note: Need to make sure we handle subgroups
Scripting API proposal:
{{velocity}} ## Parameters for the 'template' MimeMessageFactory #set ($templateParameters = {'language' : $xcontext.language, 'velocityVariables' : { 'var1' : 'value1' }}) #set ($templateReference = $services.model.createDocumentReference('', 'Space', 'MailTemplatePage')) #set ($parameters = {'hint' : 'template', 'parameters' : $templateParameters, 'source' : $templateReference}) #set ($groupReference = $services.model.createDocumentReference('', 'XWiki', 'MyGroup')) #set ($user1Reference = $services.model.createDocumentReference('', 'XWiki', 'User1')) #set ($user2Reference = $services.model.createDocumentReference('', 'XWiki', 'User2')) #set ($source = {'groups' : [$groupReference], 'users' : [$user1Reference, $user2Reference], 'emails' : ['john@doe.com'], 'excludedUsers' : [], 'excludedEmails' : [], 'excludedGroups' : []}) #set ($messages = $services.mailsender.createMessages('usersandgroups', $source, $parameters)) #set ($mailResult = $services.mailsender.send($messages, 'database')) {{/velocity}}
Attachments
Issue Links
- depends on
-
XWIKI-11780 Provide an Iterator to iterate over all the members of groups
- Closed
- is duplicated by
-
XWIKI-11674 Allow adding or removing a list of users when sending a mail to a group
- Closed