Description
In /xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin§ion=Registration Velocity scripts for verification and confirmation emails use $request.getRequestURL(), which returns localhost, if XWiki runs behind proxy.
If it is changed to $xwiki.getRequestURL() then URLs are shown correctly. So changed scripts should like something like this (I was not sure about getting user name, so dropped this part):
1. for validation:
Hello, This email address was used to register a new account on ${host}. If you did not make the request, please ignore this message. In order to activate your account, please follow this link: ${host}${xwiki.getURL('XWiki.AccountValidation', 'view', "validkey=${validkey}&xwikiname=${xwikiname}")}
2. For confirmation:
#set ($username = $context.user) #set ($host = ${xwiki.getRequestURL()}) #set ($host = ${host.substring(0, ${host.indexOf('/', ${mathtool.add(${host.indexOf('//')}, 2)})})}) Subject: Your account on ${host} has been activated Hello ${xwiki.getUserName($context.user, false)}, Your account on ${host} has been successfully activated. You can now login at ${host}${xwiki.getURL('XWiki.XWikiLogin', 'login')} using your username (${xwiki.getDocument($username).getName()}).