Hi Gabriel, On Fri, Aug 9, 2019 at 2:07 PM Gabriel Raileanu <gabriel.raile...@xwiki.com> wrote:
> Hello everyone! > > Currently, I'm working on moving to the new Mail Sender API for share page > by mail, which is related in XWiki-11786 > <https://jira.xwiki.org/browse/XWIKI-11786>. After having some discussions > with Vincent, we decided to include the possibility of sending the email to > groups, related in XWiki-12112 <https://jira.xwiki.org/browse/XWIKI-12112 > >. > > Even if everything looks good for now, a problem just appeared when trying > to access the recipient name (it's used in the email body, for addressing > the recipient (*Hello ${recipientName}*). > It seems like the new API it's not providing other information than the > email address, which was confirmed by XWiki-12207 > <https://jira.xwiki.org/browse/XWIKI-12207>. > > For now, I worked here > <https://github.com/arcilli/xwiki-platform/tree/XWIKI-12112> with some > code > from Vincent's commits > <https://github.com/xwiki/xwiki-platform/tree/feature-sharepage-group>. > > Also, after a few discussions with Marius, we concluded that for having the > name of the recipient in the message, the code needs some refactoring, > which can take a considerable amount of time. > Another solution is to > exclude the *recipientName *from the body of the message and keep only > *Hello > *(which would be a regression). This will be a shorter solution, but with > the benefit of having the possibility to send emails to groups. > What's your opinion on this? > I'm hesitating. In any case, I wouldn't remove ${recipientName} from the mail template. I would use Velocity's silent notation and add a FIXME comment to explain that the recipient name is not available until we fix XWiki-12207. Plus add a comment on XWiki-12207 to remember to fix the Share Page by email template when we close it. There's also the small issue that the Mail Sender API expects separate lists with users, groups and mail addresses, while on the UI we currently have a single input and I would keep it that way, i.e. a single input that suggests users and groups and that allows you to enter free text (mail addresses). So we would need to split the submitted list into users, groups and mail addresses. Not complex but something to keep in mind. > > Thanks a lot! > > Have a nice day! > -- > <http://www.xwiki.com/> *Gabriel Răileanu* > *Software Developer Engineer Intern* > gabriel.raile...@xwiki.com >