[Library | Trunk]: Add adminPortalURL property for composer.ts

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58655 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-05-08 15:01:59 +00:00
parent 72b48a0811
commit a0aff69243
3 changed files with 10 additions and 9 deletions

View File

@ -3,7 +3,7 @@ import {HttpParams} from '@angular/common/http';
export class ConnectHelper {
public static getCommunityFromDomain(domain: string): string{
domain = "beta.covid-19.openaire.eu"; //for testing
//domain = "beta.covid-19.openaire.eu"; //for testing
if (domain.indexOf('openaire.eu') === -1) {
return null;
}

View File

@ -13,9 +13,9 @@ export class Composer {
private static openaireAddress = "<a href='https://www.openaire.eu'>www.openaire.eu</a><br>";
private static signature = Composer.closing + "<br>" + Composer.openaireAddress;
private static ifYouAreNotResponsible(): string {
private static ifYouAreNotResponsible(mail): string {
return "If you are not responsible for this community, please "
+ "<a href=\'" + this.openaireEmail + "\'>contact us</a>. ";
+ "<a href=\mailto:'" + mail + "\'>contact us</a>. ";
}
private static manageNotificationSettings(communityId: string): string {
@ -28,7 +28,7 @@ export class Composer {
+ "<a href='https://beta." + communityId + ".openaire.eu/'>" + communityName + "</a>. ";
}
public static composeEmailForNewManager(communityId: string, communityName: string, newCommunityManagers: any): Email {
public static composeEmailForNewManager(communityId: string, communityName: string, newCommunityManagers: any, mail: string): Email {
let email: Email = new Email();
email.subject = this.subjectPrefix + communityName + ": Welcome new manager";
@ -42,7 +42,7 @@ export class Composer {
+ "You can access the administration tool by clicking the \"Manage\" button that will be available in the top right corner of the dashboard."
+ "</p>"
+ this.signature
+ "<p style='font-size:" + this.noteFontSize + "'>" + this.ifYouAreNotResponsible() + "<p>"
+ "<p style='font-size:" + this.noteFontSize + "'>" + this.ifYouAreNotResponsible(mail) + "<p>"
+ "</div>";
email.recipients = newCommunityManagers;
@ -90,7 +90,7 @@ export class Composer {
return email;
}
public static composeEmailToInformOldManagersForTheNewOnes(communityName: string, communityId: string, firstVersionOfManagers: any, managers: any) : Email {
public static composeEmailToInformOldManagersForTheNewOnes(communityName: string, communityId: string, firstVersionOfManagers: any, managers: any, mail: string) : Email {
let email: Email = new Email();
email.subject = this.subjectPrefix + communityName + ": Managers list notification";
@ -100,7 +100,7 @@ export class Composer {
+ this.signature
+ "<p style='font-size:" + this.noteFontSize + "'>"
+ this.youAreManagerOfTheCommunity(communityId, communityName)
+ this.ifYouAreNotResponsible()
+ this.ifYouAreNotResponsible(mail)
+ "<br>"
+ this.manageNotificationSettings(communityId)
+ "</p>"
@ -110,13 +110,13 @@ export class Composer {
return email;
}
public static composeEmailToInformManagers(communityName: string, communityId: string, managers: any, subscriberMail: any): Email {
public static composeEmailToInformManagers(communityName: string, communityId: string, managers: any, subscriberMail: any, adminPortalURL: string): Email {
let email: Email = new Email();
email.subject = this.subjectPrefix + communityName + ": New subscriber notification";
email.body = "<div style='font-size" + this.noteBodySize + "'>"
+ "<p>There is a new subscriber ("+subscriberMail+") for \"" + communityName + "\" community. Click "
+ "<a href='https://beta.admin.connect.openaire.eu/manage-subscribers?communityId="
+ "<a href='" + adminPortalURL + "/manage-subscribers?communityId="
+ communityId + "'>here</a> to manage the subscribers list. </p>"
+ this.signature
+ "<p style='font-size:" + this.noteFontSize + "'>"

View File

@ -158,4 +158,5 @@ export class EnvProperties {
indexInfoAPI: string;
altMetricsAPIURL: string;
b2noteAPIURL: string;
adminPortalURL: string;
}