Revision 54359
Added by Sofia Baltzi over 5 years ago
modules/uoa-admin-portal/trunk/src/app/pages/community/community-edit-form/community-edit-form.component.ts | ||
---|---|---|
241 | 241 |
}, |
242 | 242 |
error => console.log(error) |
243 | 243 |
); |
244 |
|
|
245 |
// this._emailService.sendEmail(this.properties.adminToolsAPIURL + "/sendMail/", |
|
246 |
// this.composeEmailForNewManager(this.community.title, managers)).subscribe( |
|
247 |
// res => { |
|
248 |
// console.log("The email has been sent successfully!") |
|
249 |
// }, |
|
250 |
// error => console.log(error) |
|
251 |
// ); |
|
252 | 244 |
} |
253 | 245 |
|
254 | 246 |
private informOldManagersForTheNewOnes(managers: any) { |
... | ... | |
261 | 253 |
}, |
262 | 254 |
error => console.log(error) |
263 | 255 |
); |
264 |
|
|
265 |
// this._emailService.sendEmail(this.properties.adminToolsAPIURL + "/notifyForNewManagers/" + this.communityId, |
|
266 |
// this.composeEmailToInformOldManagersForTheNewOnes(this.community.title, |
|
267 |
// this.communityId, |
|
268 |
// this.firstVersionOfManagers)).subscribe( |
|
269 |
// res => { |
|
270 |
// console.log("The email has been sent successfully!") |
|
271 |
// }, |
|
272 |
// error => console.log(error) |
|
273 |
// ); |
|
274 | 256 |
} |
275 | 257 |
|
276 |
private composeEmailForNewManager(communityName: string, newCommunityManagers: any): Email { |
|
277 |
this.email.subject = "[OpenAIRE-Connect] " + communityName + ": Welcome new manager"; |
|
278 |
this.email.body = "<div style='font-size:14px;'><p>Welcome to OpenAIRE Connect!</p>" |
|
279 |
+ "<p>You are receiving this e-mail as you were assigned as manager of the community <a href='https://beta." |
|
280 |
+ this.communityId + ".openaire.eu/'>" + "\"" + communityName + "\"" + "</a> dashboard. " |
|
281 |
+ "In order to access the administration section of your community you must first login using one of the available options. " |
|
282 |
+ "<br>The administrative rights are associated to the e-mail address, that was used to send you this message." |
|
283 |
+ " If you login with an account associated to a different email, please <a href='mailto:helpdesk@openaire.eu'>contact us</a>" |
|
284 |
+ " or your colleagues, that already have access to the administration tool, to update your e-mail. <br>" |
|
285 |
+ "You can access the administration tool by clicking the \"Manage\" button that will be available in the top right corner of the dashboard." |
|
286 |
+ "</p>" |
|
287 |
+ "OpenAIRE team<br>" + "<a href='https://www.openaire.eu'>www.openaire.eu</a><br>" |
|
288 |
+ "<p style='font-size:11px;'>If you are not responsible for this community, please " |
|
289 |
+ "<a href='mailto:openaire.test@gmail.com'>contact us</a>.</p></div>"; |
|
290 |
this.email.recipients = newCommunityManagers; |
|
291 |
|
|
292 |
console.log(this.email); |
|
293 |
|
|
294 |
return this.email; |
|
295 |
} |
|
296 |
|
|
297 |
// TODO find the right place to write it |
|
298 |
private composeEmailToInformOldManagersForTheNewOnes(communityName: string, communityId: string, firstVersionOfManagers: any) : Email { |
|
299 |
this.emailToInform.subject = "[OpenAIRE-Connect] " + communityName + ": Managers list notification"; |
|
300 |
this.emailToInform.body = "<div style='font-size:14px;'>" |
|
301 |
+ "<p>There are updates in the managers list for \"" + communityName + "\" community.<br>" |
|
302 |
+ "The list of managers is: " + this.community.managers.join(', ') + "</p>" |
|
303 |
+ "OpenAIRE team<br>" + "<a href='https://www.openaire.eu'>www.openaire.eu</a><br>" |
|
304 |
+ "<p style='font-size:11px;'>You are receiving this e-mail as manager of the community " |
|
305 |
+ "<a href='https://beta." + communityId + ".openaire.eu/'>" + communityName + "</a>. " |
|
306 |
+ "If you are not responsible for this community, please " |
|
307 |
+ "<a href='mailto:openaire.test@gmail.com'>contact us</a>." |
|
308 |
+ "<br>" |
|
309 |
+ "Click <a href='https://beta.admin.connect.openaire.eu/manage-user-notifications?communityId=" + communityId |
|
310 |
+ "'>here</a> to manage your notification settings. </p>" |
|
311 |
+ "</div>"; |
|
312 |
|
|
313 |
this.emailToInform.recipients = firstVersionOfManagers; |
|
314 |
|
|
315 |
return this.emailToInform; |
|
316 |
} |
|
317 |
|
|
318 | 258 |
private subscribeNewManagers(newManagers: string[]): boolean { |
319 | 259 |
return true; |
320 | 260 |
} |
Also available in: Unified diff
Remove unused methods, there are in library's composer