From 7871be91b01f0d53c87f39a1bb5f984b0730f119 Mon Sep 17 00:00:00 2001
From: "sofia.baltzi"
Date: Tue, 18 Dec 2018 12:18:49 +0000
Subject: [PATCH] Move formatEmailBody to composer
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@54443 d315682c-612b-4755-9ff5-7f18f6832af3
---
.../subscribe/invite/invite.component.ts | 24 ++++---------------
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git a/src/app/utils/subscribe/invite/invite.component.ts b/src/app/utils/subscribe/invite/invite.component.ts
index 117b0e0..581bf5a 100644
--- a/src/app/utils/subscribe/invite/invite.component.ts
+++ b/src/app/utils/subscribe/invite/invite.component.ts
@@ -8,6 +8,7 @@ import {ConnectHelper} from '../../../openaire
import {Email} from '../../../openaireLibrary/utils/email/email';
import {Body} from '../../../openaireLibrary/utils/email/body';
import {Validator} from '../../../openaireLibrary/utils/email/validator';
+import {Composer} from '../../../openaireLibrary/utils/email/composer';
import {EnvProperties} from '../../../openaireLibrary/utils/properties/env-properties';
import {EmailService} from '../../../openaireLibrary/utils/email/email.service';
@@ -45,7 +46,6 @@ export class InviteComponent implements OnInit {
private ckeditorContent: string;
- // public defaultBody = 'OpenAIRE invites you to subscribe in _Community_name_ dashboard.
The community dashboard is part of the OpenAIRE-Connect project.
';
public defaultBody ='';
public communityIdParam = {};
@@ -86,7 +86,8 @@ export class InviteComponent implements OnInit {
this.fullname = Session.getUserFullName();
console.log("Fullname from session " + Session.getUserFullName());
this.defaultBody = 'You are invited to subscribe to ' + this.community.title + ' dashboard.'
- + '
The purpose of this dashboard is to gather, link & monitor the research results related to your community.
The community dashboard is part of the OpenAIRE-Connect project and currently is in BETA version.
';
+ + '
The purpose of this dashboard is to gather, link & monitor the research results related to your community.
'
+ + 'The community dashboard is part of the OpenAIRE-Connect project and currently is in BETA version.
';
// TODO move the initialisation
this.body = {fromMessage: ", on behalf of ", fromName: this.fullname, paragraphs: this.defaultBody, signature: "OpenAIRE team", note: ""};
@@ -191,24 +192,7 @@ export class InviteComponent implements OnInit {
public composeEmail() {
// this.email.subject = "[OpenAIRE-Connect] Community_name";
- this.email.body = this.formatEmailBody();
- }
-
- public formatEmailBody(): string {
- let fromMessageAndName = "";
-
- if (this.body.fromName != "") {
- fromMessageAndName = "" + this.body.fromMessage + this.body.fromName + "";
- }
-
- let formattedEmail = ""
- + this.body.paragraphs
- + "
" + this.body.signature + fromMessageAndName + "
"
- + "www.openaire.eu"
- + "
"
- + "
";
-
- return formattedEmail;
+ this.email.body = Composer.formatEmailBodyForInvitation(this.body);
}
public handleError(error) {