Revision 54460
Added by Sofia Baltzi over 5 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/email/composer.ts | ||
---|---|---|
7 | 7 |
|
8 | 8 |
// TODO move to properties |
9 | 9 |
private static openaireEmail = "mailto:openaire.test@gmail.com"; |
10 |
private static subjectPrefix = "[OpenAIRE-Connect] "; |
|
11 |
private static closing = "OpenAIRE team" |
|
10 | 12 |
private static openaireAddress = "<a href='https://www.openaire.eu'>www.openaire.eu</a><br>"; |
11 |
private static signature = "OpenAIRE team<br>" + Composer.openaireAddress;
|
|
13 |
private static signature = Composer.closing + "<br>" + Composer.openaireAddress;
|
|
12 | 14 |
|
13 | 15 |
private static ifYouAreNotResponsible(): string { |
14 | 16 |
return "If you are not responsible for this community, please " |
... | ... | |
28 | 30 |
public static composeEmailForNewManager(communityId: string, communityName: string, newCommunityManagers: any): Email { |
29 | 31 |
let email: Email = new Email(); |
30 | 32 |
|
31 |
email.subject = "[OpenAIRE-Connect] " + communityName + ": Welcome new manager";
|
|
33 |
email.subject = this.subjectPrefix + communityName + ": Welcome new manager";
|
|
32 | 34 |
email.body = "<div style='font-size:" + this.noteBodySize + "'><p>Welcome to OpenAIRE Connect!</p>" |
33 | 35 |
+ "<p>You are receiving this e-mail as you were assigned as manager of the community <a href='https://beta." |
34 | 36 |
+ communityId + ".openaire.eu/'>" + communityName + "</a> dashboard. " |
... | ... | |
49 | 51 |
public static composeEmailToInformOldManagersForTheNewOnes(communityName: string, communityId: string, firstVersionOfManagers: any, managers: any) : Email { |
50 | 52 |
let email: Email = new Email(); |
51 | 53 |
|
52 |
email.subject = "[OpenAIRE-Connect] " + communityName + ": Managers list notification";
|
|
54 |
email.subject = this.subjectPrefix + communityName + ": Managers list notification";
|
|
53 | 55 |
email.body = "<div style='font-size:" + this.noteBodySize + "'>" |
54 | 56 |
+ "<p>There are updates in the managers list for \"" + communityName + "\" community.<br>" |
55 | 57 |
+ "The list of managers is: " + managers.join(', ') + "</p>" |
... | ... | |
69 | 71 |
public static composeEmailToInformManagers(communityName: string, communityId: string, managers: any): Email { |
70 | 72 |
let email: Email = new Email(); |
71 | 73 |
|
72 |
email.subject = "[OpenAIRE-Connect] " + communityName + ": New subscriber notification";
|
|
74 |
email.subject = this.subjectPrefix + communityName + ": New subscriber notification";
|
|
73 | 75 |
email.body = "<div style='font-size" + this.noteBodySize + "'>" |
74 | 76 |
+ "<p>There is a new subscriber for \"" + communityName + "\" community. Click " |
75 | 77 |
+ "<a href='https://beta.admin.connect.openaire.eu/manage-subscribers?communityId=" |
... | ... | |
103 | 105 |
return formattedEmail; |
104 | 106 |
} |
105 | 107 |
|
106 |
public static initializeInvitationEmailsBody(communityId: string, communityTitle: string): string { |
|
107 |
return '<p>You are invited to subscribe to <a href="https://beta.' + communityId + '.openaire.eu/">' |
|
108 |
+ communityTitle + '</a> dashboard.<br>' |
|
109 |
+ 'The purpose of this dashboard is to gather, link & monitor the research results related to your community.</p>' |
|
110 |
+ '<p>The community dashboard is part of the <a href="https://connect.openaire.eu/">OpenAIRE-Connect</a> ' |
|
111 |
+ 'project and currently is in BETA version.' |
|
112 |
+ '</p>'; |
|
108 |
public static initializeInvitationsBody(communityId: string, communityTitle: string, fullname: string): Body { |
|
109 |
let body: Body = new Body(); |
|
110 |
let defaultMainBody = '<p>You are invited to subscribe to <a href="https://beta.' + communityId + '.openaire.eu/">' |
|
111 |
+ communityTitle + '</a> dashboard.<br>' |
|
112 |
+ 'The purpose of this dashboard is to gather, link & monitor the research results related to your community.</p>' |
|
113 |
+ '<p>The community dashboard is part of the <a href="https://connect.openaire.eu/">OpenAIRE-Connect</a> ' |
|
114 |
+ 'project and currently is in BETA version.' |
|
115 |
+ '</p>'; |
|
116 |
|
|
117 |
return body = {fromMessage: ", on behalf of ", fromName: fullname, paragraphs: defaultMainBody, signature: this.closing, note: ""}; |
|
113 | 118 |
} |
114 | 119 |
|
120 |
public static initializeInvitationsEmail(communityTitle: string) { |
|
121 |
let email: Email = new Email(); |
|
122 |
|
|
123 |
return email = {body: "", subject: this.subjectPrefix + communityTitle, recipients: []}; |
|
124 |
} |
|
115 | 125 |
} |
Also available in: Unified diff
Add email initialization to composer and parameterize subject's prefix