From f1d415ab0b006765868402e7ecd16fb2a91e0461 Mon Sep 17 00:00:00 2001 From: "sofia.baltzi" Date: Thu, 13 Dec 2018 11:50:07 +0000 Subject: [PATCH] Use composer git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@54353 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../utils/subscribe/subscribe.component.ts | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/app/utils/subscribe/subscribe.component.ts b/src/app/utils/subscribe/subscribe.component.ts index a4db7e9..800836c 100644 --- a/src/app/utils/subscribe/subscribe.component.ts +++ b/src/app/utils/subscribe/subscribe.component.ts @@ -10,6 +10,7 @@ import {EmailService} from "../../openaireLibrary/utils/email/email.service"; import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Email} from "../../openaireLibrary/utils/email/email"; +import {Composer} from "../../openaireLibrary/utils/email/composer"; declare var UIkit: any; @@ -113,7 +114,7 @@ export class SubscribeComponent { } else { if(!this.subscribed){ this.subscribed = true; - this._emailService.sendEmail(this.properties.adminToolsAPIURL + "/notifyForNewSubscribers/" + this.communityId, this.composeEmailToInformManagers(this.community.title, this.communityId, this.community.managers)).subscribe( + this._emailService.sendEmail(this.properties.adminToolsAPIURL + "/notifyForNewSubscribers/" + this.communityId, Composer.composeEmailToInformManagers(this.community.title, this.communityId, this.community.managers)).subscribe( res => { console.log("The email has been sent successfully!") }, @@ -125,28 +126,28 @@ export class SubscribeComponent { } } - // TODO find the right place to write it - composeEmailToInformManagers(communityName: string, communityId: string, managers: any): Email { - this.emailToInformManagers.subject = "[OpenAIRE-Connect] " + communityName + ": New subscriber notification"; - this.emailToInformManagers.body = "
" - +"

There is a new subscriber for \"" + communityName + "\" community. Click " - + "here to manage the subscibers list.

" - + "

OpenAIRE team
www.openaire.eu


" - + "

You are receiving this e-mail as manager of the community " - + "" + communityName + ". " - + "If you are not responsible for this community, please " - + "contact us." - + "
" - + "Click here to manage your notification settings.

" - + "
"; - - this.emailToInformManagers.recipients = managers; - console.log(this.emailToInformManagers); - - return this.emailToInformManagers; - } + // // TODO find the right place to write it + // composeEmailToInformManagers(communityName: string, communityId: string, managers: any): Email { + // this.emailToInformManagers.subject = "[OpenAIRE-Connect] " + communityName + ": New subscriber notification"; + // this.emailToInformManagers.body = "
" + // +"

There is a new subscriber for \"" + communityName + "\" community. Click " + // + "here to manage the subscibers list.

" + // + "

OpenAIRE team
www.openaire.eu


" + // + "

You are receiving this e-mail as manager of the community " + // + "" + communityName + ". " + // + "If you are not responsible for this community, please " + // + "contact us." + // + "
" + // + "Click here to manage your notification settings.

" + // + "
"; + // + // this.emailToInformManagers.recipients = managers; + // console.log(this.emailToInformManagers); + // + // return this.emailToInformManagers; + // } unsubscribe(){ var email = Session.getUserEmail();