From 282b0b0d538d8c7932400c44c1c2c8ed1675a3f4 Mon Sep 17 00:00:00 2001 From: Antonis Lempesis Date: Thu, 30 Jul 2020 11:49:24 +0000 Subject: [PATCH] added the option to send emails to users --- .../repo/manager/controllers/RepositoryController.java | 4 ++-- .../java/eu/dnetlib/repo/manager/service/EmailUtilsImpl.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/dnetlib/repo/manager/controllers/RepositoryController.java b/src/main/java/eu/dnetlib/repo/manager/controllers/RepositoryController.java index e9e6817..10cc8e2 100644 --- a/src/main/java/eu/dnetlib/repo/manager/controllers/RepositoryController.java +++ b/src/main/java/eu/dnetlib/repo/manager/controllers/RepositoryController.java @@ -170,7 +170,7 @@ public class RepositoryController { public RepositoryInterface addRepositoryInterface(@RequestParam("datatype") String datatype, @RequestParam("repoId") String repoId, @RequestParam("registeredBy") String registeredBy, - @RequestParam("comment") String comment, + @RequestParam(value = "comment", required = false) String comment, @RequestBody RepositoryInterface repositoryInterface) throws Exception { return repositoryService.addRepositoryInterface(datatype, repoId, registeredBy, comment, repositoryInterface); } @@ -227,7 +227,7 @@ public class RepositoryController { @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or ((@repositoryService.getRepositoryById(#repoId).registeredBy==authentication.userInfo.email or @repositoryService.getRepositoryById(#repoId).registeredBy=='null') and hasRole('ROLE_USER'))") public RepositoryInterface updateRepositoryInterface(@RequestParam("repoId") String repoId, @RequestParam("registeredBy") String registeredBy, - @RequestParam("comment") String comment, + @RequestParam(value = "comment", required = false) String comment, @RequestBody RepositoryInterface repositoryInterface) throws Exception { return repositoryService.updateRepositoryInterface(repoId, registeredBy, comment, repositoryInterface); } diff --git a/src/main/java/eu/dnetlib/repo/manager/service/EmailUtilsImpl.java b/src/main/java/eu/dnetlib/repo/manager/service/EmailUtilsImpl.java index e506dbb..b213810 100644 --- a/src/main/java/eu/dnetlib/repo/manager/service/EmailUtilsImpl.java +++ b/src/main/java/eu/dnetlib/repo/manager/service/EmailUtilsImpl.java @@ -295,7 +295,7 @@ public class EmailUtilsImpl implements EmailUtils { try { String subject = "OpenAIRE new interface registration request started for " + repository.getDatasourceType() + "[" + repository.getEnglishName() + "]"; - + String message = "Dear "+SecurityContextHolder.getContext().getAuthentication().getName()+",\n" + "\n" + "We received a request to add the following interface: \n\n" +