Revision 56636
Added by Antonis Lempesis almost 5 years ago
EmailUtilsImpl.java | ||
---|---|---|
44 | 44 |
@Value("${services.repomanager.usagestats.adminEmail}") |
45 | 45 |
private String usageStatsAdminEmail; |
46 | 46 |
|
47 |
@Value("${services.provide.adminEmail}") |
|
48 |
private String provideAdminEmail; |
|
47 | 49 |
|
50 |
|
|
48 | 51 |
@PostConstruct |
49 | 52 |
public void init(){ |
50 | 53 |
System.out.println("url -> " + this.baseUrl); |
... | ... | |
191 | 194 |
} |
192 | 195 |
|
193 | 196 |
@Override |
194 |
public void sendUserRegistrationEmail(Repository repository, Authentication authentication) throws Exception{
|
|
197 |
public void sendAdminRegistrationEmail(Repository repository, Authentication authentication) throws Exception {
|
|
195 | 198 |
try { |
196 | 199 |
String subject = "OpenAIRE content provider registration request started for " + |
197 | 200 |
repository.getDatasourceType() + "[" + repository.getEnglishName() + "]"; |
198 | 201 |
|
202 |
String message = "Dear administrator" + ",\n" + |
|
203 |
"\n" + |
|
204 |
"We received a request to register the " + repository.getDatasourceType() + "[" + repository.getEnglishName() + "]" + |
|
205 |
" to the OpenAIRE compliant list of content providers. " + |
|
206 |
"A validation process against the OpenAIRE guidelines compatibility " + |
|
207 |
"has been started. You will be informed in another message once the process is finished." + |
|
208 |
"\n\n" + |
|
209 |
"Please do not reply to this message\n" + |
|
210 |
"This message has been generated automatically.\n\n" + |
|
211 |
"Regards,\n" + |
|
212 |
"the OpenAIRE technical team\n"; |
|
213 |
|
|
214 |
this.sendMail(this.provideAdminEmail, subject, message, false, null); |
|
215 |
|
|
216 |
} catch (Exception e) { |
|
217 |
LOGGER.error("Error while sending registration notification email to the administrator", e); |
|
218 |
throw e; |
|
219 |
} |
|
220 |
} |
|
221 |
|
|
222 |
@Override |
|
223 |
public void sendUserRegistrationEmail(Repository repository, Authentication authentication) throws Exception { |
|
224 |
try { |
|
225 |
String subject = "OpenAIRE content provider registration request started for " + |
|
226 |
repository.getDatasourceType() + "[" + repository.getEnglishName() + "]"; |
|
227 |
|
|
199 | 228 |
String message = "Dear " + ((OIDCAuthenticationToken) authentication).getUserInfo().getName() + ",\n" + |
200 | 229 |
"\n" + |
201 | 230 |
"We received a request to register the " + repository.getDatasourceType() + "[" + repository.getEnglishName() + "]" + |
202 |
" to the OpenAIRE compliant list of content providers.\n " +
|
|
231 |
" to the OpenAIRE compliant list of content providers. " + |
|
203 | 232 |
"A validation process against the OpenAIRE guidelines compatibility " + |
204 | 233 |
"has been started. You will be informed in another message once the process is finished." + |
205 |
"\n" + |
|
206 |
"Please do not reply to this message.\n" +
|
|
207 |
"This message has been generated automatically.\n" + |
|
234 |
"\n\n" +
|
|
235 |
"Please do not reply to this message\n" + |
|
236 |
"This message has been generated automatically.\n\n" +
|
|
208 | 237 |
"If you have any questions, write to 'helpdesk@openaire.eu'. \n\n" + |
209 | 238 |
"Regards,\n" + |
210 | 239 |
"the OpenAIRE technical team\n"; |
... | ... | |
218 | 247 |
} |
219 | 248 |
|
220 | 249 |
@Override |
250 |
public void sendAdminUpdateRepositoryEmail(Repository repository, Authentication authentication) throws Exception { |
|
251 |
try { |
|
252 |
String subject = "OpenAIRE content provider update request started for " + |
|
253 |
repository.getDatasourceType() + "[" + repository.getEnglishName() + "]"; |
|
254 |
|
|
255 |
String message = "Dear administrator" + ",\n" + |
|
256 |
"\n" + |
|
257 |
"We received a request to update the " + repository.getDatasourceType() + "[" + repository.getEnglishName() + "]." + |
|
258 |
"A new iteration process of the validation against the OpenAIRE guidelines compatibility has been started.\n\n" + |
|
259 |
"Please do not reply to this message\n" + |
|
260 |
"This message has been generated automatically.\n\n" + |
|
261 |
"Regards,\n" + |
|
262 |
"the OpenAIRE technical team\n"; |
|
263 |
|
|
264 |
this.sendMail(this.provideAdminEmail, subject, message, false, null); |
|
265 |
|
|
266 |
} catch (Exception e) { |
|
267 |
LOGGER.error("Error while sending registration notification email to the administrator", e); |
|
268 |
throw e; |
|
269 |
} |
|
270 |
} |
|
271 |
|
|
272 |
@Override |
|
221 | 273 |
public void sendUserUpdateRepositoryEmail(Repository repository, Authentication authentication) throws Exception { |
222 | 274 |
try { |
223 | 275 |
String subject = "OpenAIRE content provider update request started for " + |
... | ... | |
225 | 277 |
|
226 | 278 |
String message = "Dear " + ((OIDCAuthenticationToken) authentication).getUserInfo().getName() + ",\n" + |
227 | 279 |
"\n" + |
228 |
"We received a request to update the " + repository.getDatasourceType() + "[" + repository.getEnglishName() + "].\n" +
|
|
229 |
"A new iteration process of the validation against the OpenAIRE guidelines compatibility has been started.\n" + |
|
230 |
"Please do not reply to this message.\n" +
|
|
231 |
"This message has been generated automatically.\n" + |
|
280 |
"We received a request to update the " + repository.getDatasourceType() + "[" + repository.getEnglishName() + "]." + |
|
281 |
"A new iteration process of the validation against the OpenAIRE guidelines compatibility has been started.\n\n" +
|
|
282 |
"Please do not reply to this message\n" + |
|
283 |
"This message has been generated automatically.\n\n" +
|
|
232 | 284 |
"If you have any questions, write to 'helpdesk@openaire.eu'. \n\n" + |
233 | 285 |
"Regards,\n" + |
234 | 286 |
"the OpenAIRE technical team\n"; |
Also available in: Unified diff
Merged dev-api branch to trunk. merge -r54925:HEAD https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/uoa-repository-manager-service/branches/dev-api