Calling the sendAdmin email notifications for the registration and update of a repository

This commit is contained in:
Stefania Martziou 2019-05-17 07:27:19 +00:00
parent d89b15530e
commit 04995f9b50
1 changed files with 6 additions and 4 deletions

View File

@ -422,7 +422,8 @@ public class RepositoryServiceImpl implements RepositoryService {
if (responseEntity.getStatusCode().equals(HttpStatus.OK)) {
emailUtils.sendUserRegistrationEmail(repository, authentication);
}else
emailUtils.sendAdminRegistrationEmail(repository, authentication);
} else
LOGGER.debug(responseEntity.getBody().toString());
return repository;
@ -505,9 +506,10 @@ public class RepositoryServiceImpl implements RepositoryService {
HttpEntity<String> httpEntity = new HttpEntity <String> (json_repository,httpHeaders);
ResponseEntity responseEntity = restTemplate.exchange(uriComponents.toUri(),HttpMethod.POST, httpEntity, ResponseEntity.class);
if(responseEntity.getStatusCode().equals(HttpStatus.OK))
emailUtils.sendUserRegistrationEmail(repository,authentication);
else {
if(responseEntity.getStatusCode().equals(HttpStatus.OK)) {
emailUtils.sendUserRegistrationEmail(repository, authentication);
emailUtils.sendAdminRegistrationEmail(repository, authentication);
} else {
LOGGER.debug(responseEntity.getBody().toString());
}
}