refactoring
This commit is contained in:
parent
1a3399f7d7
commit
19923c19fc
|
@ -18,7 +18,10 @@ import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Component("emailUtils")
|
@Component("emailUtils")
|
||||||
|
@ -50,8 +53,6 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdministratorRequestToEnableMetrics(PiwikInfo piwikInfo) {
|
public void sendAdministratorRequestToEnableMetrics(PiwikInfo piwikInfo) {
|
||||||
|
|
||||||
try {
|
|
||||||
String subject = "[OpenAIRE-Usage Statistics] New request to enable usage statistics";
|
String subject = "[OpenAIRE-Usage Statistics] New request to enable usage statistics";
|
||||||
|
|
||||||
String message =
|
String message =
|
||||||
|
@ -67,16 +68,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.usageStatsAdminEmail, subject, message);
|
this.sendMail(this.usageStatsAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending request to enable metrics email to administrator: " + this.usageStatsAdminEmail, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserRequestToEnableMetrics(PiwikInfo piwikInfo) {
|
public void sendUserRequestToEnableMetrics(PiwikInfo piwikInfo) {
|
||||||
|
|
||||||
try {
|
|
||||||
String subject = "[OpenAIRE-Usage Statistics] Your request to enable usage statistics";
|
String subject = "[OpenAIRE-Usage Statistics] Your request to enable usage statistics";
|
||||||
|
|
||||||
String message = "Dear " + piwikInfo.getRequestorName() + ",\n" +
|
String message = "Dear " + piwikInfo.getRequestorName() + ",\n" +
|
||||||
|
@ -103,16 +98,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"The OpenAIRE team";
|
"The OpenAIRE team";
|
||||||
|
|
||||||
this.sendMail(piwikInfo.getRequestorEmail(), subject, message);
|
this.sendMail(piwikInfo.getRequestorEmail(), subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending request to enable metrics email to user: " + piwikInfo.getRequestorEmail(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdministratorMetricsEnabled(PiwikInfo piwikInfo) {
|
public void sendAdministratorMetricsEnabled(PiwikInfo piwikInfo) {
|
||||||
|
|
||||||
try {
|
|
||||||
String subject = "[OpenAIRE-Usage Statistics] Usage statistics have been enabled";
|
String subject = "[OpenAIRE-Usage Statistics] Usage statistics have been enabled";
|
||||||
|
|
||||||
String message =
|
String message =
|
||||||
|
@ -126,16 +115,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.usageStatsAdminEmail, subject, message);
|
this.sendMail(this.usageStatsAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending metrics enabled notification email to administator: " + this.usageStatsAdminEmail, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserMetricsEnabled(PiwikInfo piwikInfo) {
|
public void sendUserMetricsEnabled(PiwikInfo piwikInfo) {
|
||||||
|
|
||||||
try {
|
|
||||||
String subject = "[OpenAIRE-Usage Statistics] Usage statistics have been enabled";
|
String subject = "[OpenAIRE-Usage Statistics] Usage statistics have been enabled";
|
||||||
|
|
||||||
String message = "Dear " + piwikInfo.getRequestorName() + ",\n" +
|
String message = "Dear " + piwikInfo.getRequestorName() + ",\n" +
|
||||||
|
@ -153,15 +136,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"The OpenAIRE team";
|
"The OpenAIRE team";
|
||||||
|
|
||||||
this.sendMail(piwikInfo.getRequestorEmail(), subject, message);
|
this.sendMail(piwikInfo.getRequestorEmail(), subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending metrics enabled notification email to user: " + piwikInfo.getRequestorEmail(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminRegistrationEmail(Repository repository, Authentication authentication) {
|
public void sendAdminRegistrationEmail(Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE content provider registration for " +
|
String subject = "OpenAIRE content provider registration for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -176,15 +154,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to the administrator", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserRegistrationEmail(Repository repository, Authentication authentication) {
|
public void sendUserRegistrationEmail(Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE content provider registration for " +
|
String subject = "OpenAIRE content provider registration for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -197,16 +170,16 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"If you have any questions, write to 'helpdesk@openaire.eu'.";
|
"If you have any questions, write to 'helpdesk@openaire.eu'.";
|
||||||
message = createUserMail(message, authentication);
|
message = createUserMail(message, authentication);
|
||||||
|
|
||||||
this.sendMail(repository.getRegisteredby(), subject, message);
|
Collection<String> emailTo = new HashSet<>();
|
||||||
|
if (repository.getRegisteredby() != null) {
|
||||||
} catch (Exception e) {
|
emailTo.add(repository.getRegisteredby());
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
}
|
||||||
|
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
||||||
|
this.sendMail(emailTo, subject, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminRegisterInterfaceEmail(Repository repository, String comment, RepositoryInterface repositoryInterface, String desiredCompatibility, Authentication authentication) {
|
public void sendAdminRegisterInterfaceEmail(Repository repository, String comment, RepositoryInterface repositoryInterface, String desiredCompatibility, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE new interface registration request started for " +
|
String subject = "OpenAIRE new interface registration request started for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -214,7 +187,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"We received a request to add the following interface: \n\n" +
|
"We received a request to add the following interface: \n\n" +
|
||||||
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
|
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
|
||||||
"Set: " + repositoryInterface.getAccessSet() + "\n" +
|
"Set: " + repositoryInterface.getAccessSet() + "\n" +
|
||||||
"Selected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() + "\n\n" +
|
"Selected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) + "\n\n" +
|
||||||
"to " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
|
"to " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
|
||||||
|
|
||||||
if (comment != null)
|
if (comment != null)
|
||||||
|
@ -230,22 +203,17 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration of interface notification email to the administrator", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserRegisterInterfaceEmail(Repository repository, String comment, RepositoryInterface repositoryInterface, String desiredCompatibility, Authentication authentication) {
|
public void sendUserRegisterInterfaceEmail(Repository repository, String comment, RepositoryInterface repositoryInterface, String desiredCompatibility, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE new interface registration request started for " +
|
String subject = "OpenAIRE new interface registration request started for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
String message =
|
String message =
|
||||||
"We received a request to add the following interface: \n\n" +
|
"We received a request to add the following interface: \n\n" +
|
||||||
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
|
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
|
||||||
"Set: " + repositoryInterface.getAccessSet() + "\n" +
|
"Set: " + repositoryInterface.getAccessSet() + "\n" +
|
||||||
"Selected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() + "\n\n" +
|
"Selected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) + "\n\n" +
|
||||||
"to " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
|
"to " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
|
||||||
|
|
||||||
if (comment != null) {
|
if (comment != null) {
|
||||||
|
@ -265,15 +233,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
}
|
}
|
||||||
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
||||||
this.sendMail(emailTo, subject, message);
|
this.sendMail(emailTo, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration of interface notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserRegistrationResultsSuccessEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
public void sendUserRegistrationResultsSuccessEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE new interface registration request - results (success) for " +
|
String subject = "OpenAIRE new interface registration request - results (success) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -286,7 +249,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"\nOfficial Name:" + repository.getOfficialname() +
|
"\nOfficial Name:" + repository.getOfficialname() +
|
||||||
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
||||||
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
||||||
"\n\nSelected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
|
"\n\nSelected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) +
|
||||||
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
||||||
"\n\n\nPlease do not reply to this email\n" +
|
"\n\n\nPlease do not reply to this email\n" +
|
||||||
"This message has been generated manually\n\n" +
|
"This message has been generated manually\n\n" +
|
||||||
|
@ -299,15 +262,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
}
|
}
|
||||||
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
||||||
this.sendMail(emailTo, subject, message);
|
this.sendMail(emailTo, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminRegistrationResultsSuccessEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
public void sendAdminRegistrationResultsSuccessEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE new interface registration request - results (success) for " +
|
String subject = "OpenAIRE new interface registration request - results (success) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -320,7 +278,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"\nOfficial Name:" + repository.getOfficialname() +
|
"\nOfficial Name:" + repository.getOfficialname() +
|
||||||
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
||||||
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
||||||
"\n\nDesired Selected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
|
"\n\nDesired Selected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) +
|
||||||
"\n\nUser Contact:" + issuerEmail + "" +
|
"\n\nUser Contact:" + issuerEmail + "" +
|
||||||
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
||||||
"\n\n\nPlease do not reply to this email\n" +
|
"\n\n\nPlease do not reply to this email\n" +
|
||||||
|
@ -329,15 +287,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserRegistrationResultsFailureEmail(String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
public void sendUserRegistrationResultsFailureEmail(String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE new interface registration request - results (failure) for " +
|
String subject = "OpenAIRE new interface registration request - results (failure) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
String message =
|
String message =
|
||||||
|
@ -349,7 +302,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"\nOfficial Name:" + repository.getOfficialname() +
|
"\nOfficial Name:" + repository.getOfficialname() +
|
||||||
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
||||||
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
||||||
"\n\nSelected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
|
"\n\nSelected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) +
|
||||||
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
||||||
"\n\n\nPlease do not reply to this email\n" +
|
"\n\n\nPlease do not reply to this email\n" +
|
||||||
"This message has been generated manually\n\n" +
|
"This message has been generated manually\n\n" +
|
||||||
|
@ -362,15 +315,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
}
|
}
|
||||||
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
||||||
this.sendMail(emailTo, subject, message);
|
this.sendMail(emailTo, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminRegistrationResultsFailureEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
public void sendAdminRegistrationResultsFailureEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE new interface registration request - results (failure) for " +
|
String subject = "OpenAIRE new interface registration request - results (failure) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -383,7 +331,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"\nOfficial Name:" + repository.getOfficialname() +
|
"\nOfficial Name:" + repository.getOfficialname() +
|
||||||
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
||||||
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
||||||
"\n\nSelected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
|
"\n\nSelected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) +
|
||||||
"\n\nUser Contact:" + issuerEmail + "" +
|
"\n\nUser Contact:" + issuerEmail + "" +
|
||||||
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
||||||
"\n\n\nPlease do not reply to this email\n" +
|
"\n\n\nPlease do not reply to this email\n" +
|
||||||
|
@ -392,15 +340,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserUpdateResultsSuccessEmail(String issuer, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
public void sendUserUpdateResultsSuccessEmail(String issuer, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE interface update request - results (success) for " +
|
String subject = "OpenAIRE interface update request - results (success) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -411,7 +354,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"\nOfficial Name:" + repository.getOfficialname() +
|
"\nOfficial Name:" + repository.getOfficialname() +
|
||||||
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
||||||
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
||||||
"\n\nSelected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
|
"\n\nSelected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) +
|
||||||
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
||||||
"\n\n\nPlease do not reply to this email\n" +
|
"\n\n\nPlease do not reply to this email\n" +
|
||||||
"This message has been generated manually\n\n" +
|
"This message has been generated manually\n\n" +
|
||||||
|
@ -419,15 +362,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createUserMail(message, authentication);
|
message = createUserMail(message, authentication);
|
||||||
|
|
||||||
this.sendMail(issuer, subject, message);
|
this.sendMail(issuer, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to the administrator", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminUpdateResultsSuccessEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
public void sendAdminUpdateResultsSuccessEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE interface update request - results (success) for " +
|
String subject = "OpenAIRE interface update request - results (success) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -438,7 +376,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"\nOfficial Name:" + repository.getOfficialname() +
|
"\nOfficial Name:" + repository.getOfficialname() +
|
||||||
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
||||||
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
||||||
"\n\nSelected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
|
"\n\nSelected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) +
|
||||||
"\n\nUser Contact:" + issuerEmail + "" +
|
"\n\nUser Contact:" + issuerEmail + "" +
|
||||||
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
||||||
"\n\n\nPlease do not reply to this email\n" +
|
"\n\n\nPlease do not reply to this email\n" +
|
||||||
|
@ -447,28 +385,22 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to the administrator", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserUpdateResultsFailureEmail(String issuer, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
public void sendUserUpdateResultsFailureEmail(String issuer, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE interface update request - results (failure) for " +
|
String subject = "OpenAIRE interface update request - results (failure) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
String message =
|
String message =
|
||||||
"the compatibility test on " + "[" + repository.getOfficialname() + "]" +
|
"the compatibility test on [" + repository.getOfficialname() + "] was not successful." +
|
||||||
" was not successful." +
|
|
||||||
"\n\n" +
|
"\n\n" +
|
||||||
"WWe will check your transmitted information to see what caused the problem and get back to you within a couple of days.\n\n" +
|
"We will check your transmitted information to see what caused the problem and get back to you within a couple of days.\n\n" +
|
||||||
"Registration identifier in OpenAIRE: " + repository.getNamespaceprefix() +
|
"Registration identifier in OpenAIRE: " + repository.getNamespaceprefix() +
|
||||||
"\nOfficial Name:" + repository.getOfficialname() +
|
"\nOfficial Name:" + repository.getOfficialname() +
|
||||||
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
||||||
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
||||||
"\n\nSelected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
|
"\n\nSelected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) +
|
||||||
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
||||||
"\n\n\nPlease do not reply to this email\n" +
|
"\n\n\nPlease do not reply to this email\n" +
|
||||||
"This message has been generated manually\n\n" +
|
"This message has been generated manually\n\n" +
|
||||||
|
@ -476,15 +408,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createUserMail(message, authentication);
|
message = createUserMail(message, authentication);
|
||||||
|
|
||||||
this.sendMail(issuer, subject, message);
|
this.sendMail(issuer, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminUpdateResultsFailureEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
public void sendAdminUpdateResultsFailureEmail(String issuerEmail, String jobId, RepositoryInterface repositoryInterface, String desiredCompatibility, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE interface update request - results (failure) for " +
|
String subject = "OpenAIRE interface update request - results (failure) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -497,7 +424,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"\nOfficial Name:" + repository.getOfficialname() +
|
"\nOfficial Name:" + repository.getOfficialname() +
|
||||||
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
"\n\nBase URL: " + repositoryInterface.getBaseurl() +
|
||||||
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
"\n\nSet: " + repositoryInterface.getAccessSet() +
|
||||||
"\n\nSelected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() +
|
"\n\nSelected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) +
|
||||||
"\n\nUser Contact:" + issuerEmail + "" +
|
"\n\nUser Contact:" + issuerEmail + "" +
|
||||||
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
"\n\nYou can review the validation results here.\n" + valBaseUrl + "" + jobId +
|
||||||
"\n\n\nPlease do not reply to this email\n" +
|
"\n\n\nPlease do not reply to this email\n" +
|
||||||
|
@ -506,15 +433,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserUpdateInterfaceComplianceFailure(List<String> emails, Repository repository, RepositoryInterface repositoryInterface, InterfaceComplianceRequest request) {
|
public void sendUserUpdateInterfaceComplianceFailure(List<String> emails, Repository repository, RepositoryInterface repositoryInterface, InterfaceComplianceRequest request) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE interface update compliance request - results (failure) for " +
|
String subject = "OpenAIRE interface update compliance request - results (failure) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -534,15 +456,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createRepoAdminsMail(message);
|
message = createRepoAdminsMail(message);
|
||||||
|
|
||||||
this.sendMail(emails, subject, message);
|
this.sendMail(emails, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Notification email to repository admins failed.\nRepository: {}\nRequest: {}", repository, request, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminUpdateInterfaceComplianceFailure(Repository repository, RepositoryInterface repositoryInterface, InterfaceComplianceRequest request) {
|
public void sendAdminUpdateInterfaceComplianceFailure(Repository repository, RepositoryInterface repositoryInterface, InterfaceComplianceRequest request) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE interface update compliance request - results (failure) for " +
|
String subject = "OpenAIRE interface update compliance request - results (failure) for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -562,15 +479,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserValidationResults(String issuer, String jobId, RepositoryInterface repositoryInterface, Repository repository, Authentication authentication) {
|
public void sendUserValidationResults(String issuer, String jobId, RepositoryInterface repositoryInterface, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE validator - Test results ";
|
String subject = "OpenAIRE validator - Test results ";
|
||||||
|
|
||||||
String message =
|
String message =
|
||||||
|
@ -581,20 +493,16 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createUserMail(message, authentication);
|
message = createUserMail(message, authentication);
|
||||||
|
|
||||||
Collection<String> emailTo = new HashSet<>();
|
Collection<String> emailTo = new HashSet<>();
|
||||||
|
emailTo.add(issuer);
|
||||||
if (repository.getRegisteredby() != null) {
|
if (repository.getRegisteredby() != null) {
|
||||||
emailTo.add(repository.getRegisteredby());
|
emailTo.add(repository.getRegisteredby());
|
||||||
}
|
}
|
||||||
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
||||||
this.sendMail(emailTo, subject, message);
|
this.sendMail(emailTo, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending validation submission notification email to user: " + issuer, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminValidationResults(String issuer, String jobId, RepositoryInterface repositoryInterface, Repository repository, Authentication authentication) {
|
public void sendAdminValidationResults(String issuer, String jobId, RepositoryInterface repositoryInterface, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE validator - Test results ";
|
String subject = "OpenAIRE validator - Test results ";
|
||||||
|
|
||||||
String message =
|
String message =
|
||||||
|
@ -606,15 +514,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending validation submission notification email to user: " + issuer, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminGeneralFailure(String issuer, String jobId, RepositoryInterface repositoryInterface, Repository repository, Authentication authentication) {
|
public void sendAdminGeneralFailure(String issuer, String jobId, RepositoryInterface repositoryInterface, Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE validator - job failure";
|
String subject = "OpenAIRE validator - job failure";
|
||||||
|
|
||||||
String message =
|
String message =
|
||||||
|
@ -626,15 +529,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending validation submission notification email to user: " + issuer, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminUpdateRepositoryInfoEmail(Repository repository, Authentication authentication) {
|
public void sendAdminUpdateRepositoryInfoEmail(Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE content provider update information for " +
|
String subject = "OpenAIRE content provider update information for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -646,15 +544,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to the administrator", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserUpdateRepositoryInfoEmail(Repository repository, Authentication authentication) {
|
public void sendUserUpdateRepositoryInfoEmail(Repository repository, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE content provider update information for " +
|
String subject = "OpenAIRE content provider update information for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -671,15 +564,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
}
|
}
|
||||||
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
||||||
this.sendMail(emailTo, subject, message);
|
this.sendMail(emailTo, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendAdminUpdateInterfaceEmail(Repository repository, String comment, RepositoryInterface repositoryInterface, String desiredCompatibility, Authentication authentication) {
|
public void sendAdminUpdateInterfaceEmail(Repository repository, String comment, RepositoryInterface repositoryInterface, String desiredCompatibility, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE interface update request started for " +
|
String subject = "OpenAIRE interface update request started for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -687,7 +575,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"We received a request to update the following interface: \n\n" +
|
"We received a request to update the following interface: \n\n" +
|
||||||
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
|
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
|
||||||
"Set: " + repositoryInterface.getAccessSet() + "\n" +
|
"Set: " + repositoryInterface.getAccessSet() + "\n" +
|
||||||
"Selected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() + "\n\n" +
|
"Selected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) + "\n\n" +
|
||||||
"for " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
|
"for " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
|
||||||
|
|
||||||
if (comment != null)
|
if (comment != null)
|
||||||
|
@ -701,15 +589,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createAdminMail(message);
|
message = createAdminMail(message);
|
||||||
|
|
||||||
this.sendMail(this.provideAdminEmail, subject, message);
|
this.sendMail(this.provideAdminEmail, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to the administrator", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendUserUpdateInterfaceEmail(Repository repository, String comment, RepositoryInterface repositoryInterface, String desiredCompatibility, Authentication authentication) {
|
public void sendUserUpdateInterfaceEmail(Repository repository, String comment, RepositoryInterface repositoryInterface, String desiredCompatibility, Authentication authentication) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE interface update request started for " +
|
String subject = "OpenAIRE interface update request started for " +
|
||||||
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "]";
|
||||||
|
|
||||||
|
@ -717,7 +600,7 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
"We received a request to update the following interface: \n\n" +
|
"We received a request to update the following interface: \n\n" +
|
||||||
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
|
"Base URL: " + repositoryInterface.getBaseurl() + "\n" +
|
||||||
"Set: " + repositoryInterface.getAccessSet() + "\n" +
|
"Set: " + repositoryInterface.getAccessSet() + "\n" +
|
||||||
"Selected Guidelines: " + desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride() + "\n\n" +
|
"Selected Guidelines: " + getSelectedGuidelines(desiredCompatibility, repositoryInterface) + "\n\n" +
|
||||||
"for " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
|
"for " + repository.getEoscDatasourceType() + "[" + repository.getOfficialname() + "].\n";
|
||||||
|
|
||||||
if (comment != null) {
|
if (comment != null) {
|
||||||
|
@ -736,15 +619,10 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
}
|
}
|
||||||
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
emailTo.add(User.from(((OIDCAuthenticationToken) authentication).getUserInfo()).getEmail());
|
||||||
this.sendMail(emailTo, subject, message);
|
this.sendMail(emailTo, subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending registration notification email to user: " + repository.getRegisteredby(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendSubmitJobForValidationEmail(Authentication authentication, JobForValidation jobForValidation) {
|
public void sendSubmitJobForValidationEmail(Authentication authentication, JobForValidation jobForValidation) {
|
||||||
try {
|
|
||||||
String subject = "OpenAIRE validator - Test submission ";
|
String subject = "OpenAIRE validator - Test submission ";
|
||||||
|
|
||||||
String message =
|
String message =
|
||||||
|
@ -755,10 +633,6 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
message = createUserMail(message, authentication);
|
message = createUserMail(message, authentication);
|
||||||
|
|
||||||
this.sendMail(jobForValidation.getUserEmail(), subject, message);
|
this.sendMail(jobForValidation.getUserEmail(), subject, message);
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error while sending validation submission notification email to user: " + jobForValidation.getUserEmail(), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -848,4 +722,8 @@ public class EmailUtilsImpl implements EmailUtils {
|
||||||
}
|
}
|
||||||
return user; // It may be just "user". TODO - Wouldn't be better if it was null?
|
return user; // It may be just "user". TODO - Wouldn't be better if it was null?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getSelectedGuidelines(String desiredCompatibility, RepositoryInterface repositoryInterface) {
|
||||||
|
return desiredCompatibility != null ? desiredCompatibility : repositoryInterface.getCompatibilityOverride();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue