How to override "New permission" notification / alert ?

Hi all,

I need to translate and override the notification mail sent when a new permission is given to someone.

I have successfully override “documentPublicationApproved”, “documentPublicationRejected”, “documentPublished”, “documentModified”, “documentCreated”, and “workflowTaskAssigned” template but I have not found how to override the “New Permission” template.

Furthermore, I wish to uncheck the box when adding a new permission.

Can you help me please ? it's urgent =\

0 votes

2 answers

1029 views

ANSWER



Thank you Yousuf Nejati :)

I found this file before leaving work, but it was too late to try this method, I will do it tomorrow.

However, this solution will not persists during updates. I would have to repeat this each time.

Do you think that this jar file will often be updated? and if it's planned to make it possible to customize this notification event ?

Thanks :)

0 votes



Hi Mohamed,

No problem.

The solution doesn't persist because the sources are generated from the bundles (jars) each time you restart the server.

I wouldn't recommend updating the source jar on a production server, it can get very, very, messy. But, on a ''play server" you can learn a lot from extracting and updating the contents of the jar files.

For permanent changes, it's better to use extension points, and so on. Also, I believe there is a specific way to contribute your own templates, if you happen to be using Nuxeo Studio.

If you're using the Nuxeo IDE, you would just override the templates in the template directory by adding these properly to your Nuxeo project and deployment bundle. Does that make sense?

Also, make sure you use the "Comment" and "Answers" features here responsibly. Meaning that this is a comment and not an answer.

Hope that helps.

Best,

-Yousuf

p.s. if you find an answer helpful, please vote on it.

06/15/2016

Hello Yousuf Nejati

Thank you very much !!! I finally could overload the file without duplicating jar file :D Ok, I will not do that mistake next time :)

Just one last question : how can i change the mail subject ? I have tried to set label.subject.new.comment=Nouveau commentaire sur {0} but it doesn't work

I need to do it for workflowTaskAssigned too, but I didn't find the label wich I must override

06/17/2016


Hello Mohamed,

That is great, that you were able to override all of those templates already. If you're looking for the template sent when permissions are changed, you can find that here:

http://explorer.nuxeo.com/nuxeo/site/distribution/cap-8.2/viewExtensionPoint/org.nuxeo.ecm.platform.ec.notification.service.NotificationService--templates#contribute

nuxeo-permissions-7.10.jar (assuming you're using the latest LTS)

aceGranted.ftl

See attached.

Hope this reaches you in time.

Best,

-Yousuf

FILES:   aceGranted.ftl
0 votes



Unlike other template configuration there is no notification configuration associated to the template (at least, I cannot find it in 7.10 platform explorer). The subject of the email cannot be customized that way for instance
10/07/2016