diff --git a/utils/email/body.ts b/utils/email/body.ts new file mode 100644 index 00000000..7de2b97c --- /dev/null +++ b/utils/email/body.ts @@ -0,0 +1,8 @@ +export class Body { + salutation: string; + fromMessage: string; + fromName: string; + paragraphs: string; + closing: string + signature: string; +} diff --git a/utils/email/email.service.ts b/utils/email/email.service.ts new file mode 100644 index 00000000..2514637d --- /dev/null +++ b/utils/email/email.service.ts @@ -0,0 +1,22 @@ +import {Injectable} from '@angular/core'; +import {Http, Response, Headers, RequestOptions} from '@angular/http'; +import {Email} from './email'; + +@Injectable() +export class EmailService { + + constructor(private http:Http) { + } + + sendEmail(url: string, email: Email) { + let headers = new Headers({'Content-Type': 'application/json'}); + let options = new RequestOptions({headers: headers}); + let body = JSON.stringify(email); + + console.log(body); + + return this.http.post(url, body, options) + .do(request => console.log("Insert Response:"+request.status)); + } + +} diff --git a/utils/email/email.ts b/utils/email/email.ts new file mode 100644 index 00000000..5c43f4c6 --- /dev/null +++ b/utils/email/email.ts @@ -0,0 +1,5 @@ +export class Email { + body: string; + subject: string; + recipients: string[]; +} diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 6f86a7c8..ce0bb0a0 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -131,6 +131,8 @@ export class EnvProperties { searchLinkToAdvancedOrganizations; searchLinkToAdvancedPeople; + sendMailUrl; + lastIndexInformationLink; showLastIndexInformationLink;