Hello,
I want to add many users account programatically .
I had used this code it create the users but without sending email confirmation.
code :
{{groovy}}
def users = [
["Jean", "Valjean"],
["Georges", "Abitbol"],
["Mohamed", "Messaoud"],
]
def allGroup = xwiki.getDocument('XWiki.XWikiAllGroup')
for(user in users){
fullName = user.get(0) + user.get(1)
udoc = xwiki.getDocument("XWiki."+fullName)
uobj = udoc.getObject("XWiki.XWikiUsers", true)
uobj.set("first_name", user.get(0))
uobj.set("last_name" , user.get(1))
uobj.set("email" , user.get(2))
print("* Registering *" + udoc.fullName + "*\n")
udoc.save()
gObj = allGroup.newObject('XWiki.XWikiGroups')
gObj.set('member',udoc.fullName)
}
allGroup.save()
{{/groovy}}
how we can send mail confirmation in code ???
Regards,
Amina Meck