diff --git a/package.json b/package.json
index 4a61f04..7515f9f 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,7 @@
"datatables.net": "^1.10.16",
"datatables.net-dt": "^1.10.16",
"jquery": "^3.2.1",
+ "ng2-ckeditor": "1.1.9",
"ngx-json-ld": "0.1.6",
"rxjs": "^5.4.2",
"ts-md5": "^1.2.0",
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index da661c9..100030a 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -9,6 +9,7 @@ import { OpenaireErrorPageComponent } from './error/errorPage.component';
const routes: Routes = [
{ path: '', loadChildren: './communitywrapper/communityWrapper.module#CommunityWrapperModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'my-communities', loadChildren: './my-communities/communities.module#MyCommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
+ { path: 'invite', loadChildren: './utils/subscribe/invite/invite.module#InviteModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'about', loadChildren: './htmlPages/about/aboutPage.module#AboutPageModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'content', loadChildren: './content/contentPage.module#ContentPageModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'organizations', loadChildren: './htmlPages/organizations/organizationsPage.module#OrganizationsPageModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 2f34c7b..fab08ff 100755
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -6,6 +6,8 @@ import {RouterModule} from '@angular/router';
import {BrowserModule} from '@angular/platform-browser';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
+import {CKEditorModule} from 'ng2-ckeditor';
+
import {AppComponent} from './app.component';
import {OpenaireErrorPageComponent} from './error/errorPage.component';
@@ -31,6 +33,8 @@ import {CommunitiesService} from './openaireLibrary/connect/communi
CommonModule,
HttpModule,
ErrorModule,
+ CKEditorModule,
+ FormsModule,
NavigationBarModule, FeedbackModule, BottomModule,
CookieLawModule,
BrowserModule.withServerTransition({appId: 'my-app'}),
diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html
index f853f33..2287318 100644
--- a/src/app/community/community.component.html
+++ b/src/app/community/community.component.html
@@ -170,3 +170,5 @@
+
+
From: | ++ + | +
To * : | +
+
+
+
+ {{email.recipients}}
+ separate multiple emails with a comma
+ |
+
+
+ |
+ {{body.salutation}} + + {{body.fromMessage}}... + + + {{body.fromMessage}} + {{body.fromName}} + + |
+
Message: | ++ + + + + + + + + | +
+ |
+ {{body.closing}} + {{body.signature}} + |
+
+ | * Required fields
+ |
+
+ |
+
+
+
+ |
+
OpenAIRE invites you to subscribe in _Community_name_ dashboard.
The community dashboard is part of the OpenAIRE-Connect project
Kind regards,
OpenAIRE team
The community dashboard is part of the OpenAIRE-Connect project
' + + @Input() communityId = null; + + constructor ( + private route: ActivatedRoute, + private _router: Router, + public _fb: FormBuilder, + private _emailService: EmailService) { } + + + public ngOnInit() { + this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { + this.properties = data.envSpecific; + this.body = {salutation: "Dear Sir/Madame,", fromMessage: "On behalf of ", fromName: "", paragraphs: "", closing: "Kind regards,", signature: "OpenAIRE team"}; + this.email = {body: "", subject: "", recipients: []}; + + }); + } + + public invite() { + if (this.email.recipients != null) { + this.composeEmail(); + console.log(this.email.body); + + this._emailService.sendEmail(this.properties.sendMailUrl, this.email).subscribe( + res => console.log("Mail has been sent successfully!") + , + error => console.log(error) + ); + } + } + + public composeEmail() { + this.email.subject = "Argiro is going to tell me about the subject"; + this.email.body = this.formatEmailBody(); + } + + public formatEmailBody(): string { + let fromMessageAndName = ""; + + if (this.body.fromName != "") { + fromMessageAndName = "" + this.body.fromMessage + this.body.fromName + ""; + } + + let formattedEmail = "" + fromMessageAndName + "..." + "
" + + "" + this.body.closing + "
" + this.body.signature + "