Compare commits

...

2 Commits

1 changed files with 31 additions and 16 deletions

View File

@ -214,7 +214,7 @@ public class EmailUtilsImpl implements EmailUtils {
"We received a request to add the following interface: \n\n" +
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
"Set: " + repositoryInterface.getAccessSet() + "\n" +
"Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() + "\n\n" +
"Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() + "\n\n" +
"to " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
if (comment != null)
@ -245,7 +245,7 @@ public class EmailUtilsImpl implements EmailUtils {
"We received a request to add the following interface: \n\n" +
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
"Set: " + repositoryInterface.getAccessSet() + "\n" +
"Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() + "\n\n" +
"Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() + "\n\n" +
"to " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
if (comment != null) {
@ -286,7 +286,7 @@ public class EmailUtilsImpl implements EmailUtils {
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
"\n\nValidation Set: " + repositoryInterface.getAccessSet() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
"\n\n\nPlease do not reply to this email\n" +
"This message has been generated manually\n\n" +
@ -320,7 +320,7 @@ public class EmailUtilsImpl implements EmailUtils {
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
"\n\nValidation Set: " + repositoryInterface.getAccessSet() +
"\n\nDesired Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() +
"\n\nDesired Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
"\n\nUser Contact:" + issuerEmail + "" +
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
"\n\n\nPlease do not reply to this email\n" +
@ -349,7 +349,7 @@ public class EmailUtilsImpl implements EmailUtils {
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
"\n\nValidation Set: " + repositoryInterface.getAccessSet() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
"\n\n\nPlease do not reply to this email\n" +
"This message has been generated manually\n\n" +
@ -375,7 +375,7 @@ public class EmailUtilsImpl implements EmailUtils {
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
String message =
"the compatibility test on " + "[" + repository.getOfficialname() + "]" +
"the compatibility test on [" + repository.getOfficialname() + "]" +
" was not successful and the registration process was interrupted." +
"\n\n" +
"We will check what caused the problem and get back to you within a couple of days.\n\n" +
@ -383,7 +383,7 @@ public class EmailUtilsImpl implements EmailUtils {
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
"\n\nValidation Set: " + repositoryInterface.getAccessSet() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
"\n\nUser Contact:" + issuerEmail + "" +
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
"\n\n\nPlease do not reply to this email\n" +
@ -411,7 +411,7 @@ public class EmailUtilsImpl implements EmailUtils {
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
"\n\nValidation Set: " + repositoryInterface.getAccessSet() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
"\n\n\nPlease do not reply to this email\n" +
"This message has been generated manually\n\n" +
@ -438,7 +438,7 @@ public class EmailUtilsImpl implements EmailUtils {
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
"\n\nValidation Set: " + repositoryInterface.getAccessSet() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
"\n\nUser Contact:" + issuerEmail + "" +
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
"\n\n\nPlease do not reply to this email\n" +
@ -468,7 +468,7 @@ public class EmailUtilsImpl implements EmailUtils {
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
"\n\nValidation Set: " + repositoryInterface.getAccessSet() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
"\n\n\nPlease do not reply to this email\n" +
"This message has been generated manually\n\n" +
@ -497,7 +497,7 @@ public class EmailUtilsImpl implements EmailUtils {
"\nOfficial Name:" + repository.getOfficialname() +
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
"\n\nValidation Set: " + repositoryInterface.getAccessSet() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() +
"\n\nGuidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
"\n\nUser Contact:" + issuerEmail + "" +
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
"\n\n\nPlease do not reply to this email\n" +
@ -580,7 +580,12 @@ public class EmailUtilsImpl implements EmailUtils {
"If you have any questions, write to 'helpdesk@openaire.eu'.";
message = createUserMail(message, authentication);
this.sendMail(issuer, subject, message);
Collection<String> emailTo = new HashSet<>();
if (repository.getRegisteredby() != null) {
emailTo.add(repository.getRegisteredby());
}
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
this.sendMail(emailTo, subject, message);
} catch (Exception e) {
logger.error("Error while sending validation submission notification email to user: " + issuer, e);
@ -660,7 +665,12 @@ public class EmailUtilsImpl implements EmailUtils {
"If you have any questions, write to 'helpdesk@openaire.eu'.";
message = createUserMail(message, authentication);
this.sendMail(repository.getRegisteredby(), subject, message);
Collection<String> emailTo = new HashSet<>();
if (repository.getRegisteredby() != null) {
emailTo.add(repository.getRegisteredby());
}
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
this.sendMail(emailTo, subject, message);
} catch (Exception e) {
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
@ -677,7 +687,7 @@ public class EmailUtilsImpl implements EmailUtils {
"We received a request to update the following interface: \n\n" +
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
"Set: " + repositoryInterface.getAccessSet() + "\n" +
"Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() + "\n\n" +
"Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() + "\n\n" +
"for " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
if (comment != null)
@ -707,7 +717,7 @@ public class EmailUtilsImpl implements EmailUtils {
"We received a request to update the following interface: \n\n" +
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
"Set: " + repositoryInterface.getAccessSet() + "\n" +
"Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibility() + "\n\n" +
"Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() + "\n\n" +
"for " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
if (comment != null) {
@ -720,7 +730,12 @@ public class EmailUtilsImpl implements EmailUtils {
"If you have any questions, write to 'helpdesk@openaire.eu'.";
message = createUserMail(message, authentication);
this.sendMail(repository.getRegisteredby(), subject, message);
Collection<String> emailTo = new HashSet<>();
if (repository.getRegisteredby() != null) {
emailTo.add(repository.getRegisteredby());
}
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
this.sendMail(emailTo, subject, message);
} catch (Exception e) {
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);