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.
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.