Add email
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@53697 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
22d4a2f105
commit
80e22d6849
|
@ -0,0 +1,8 @@
|
||||||
|
export class Body {
|
||||||
|
salutation: string;
|
||||||
|
fromMessage: string;
|
||||||
|
fromName: string;
|
||||||
|
paragraphs: string;
|
||||||
|
closing: string
|
||||||
|
signature: string;
|
||||||
|
}
|
|
@ -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));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
export class Email {
|
||||||
|
body: string;
|
||||||
|
subject: string;
|
||||||
|
recipients: string[];
|
||||||
|
}
|
|
@ -131,6 +131,8 @@ export class EnvProperties {
|
||||||
searchLinkToAdvancedOrganizations;
|
searchLinkToAdvancedOrganizations;
|
||||||
searchLinkToAdvancedPeople;
|
searchLinkToAdvancedPeople;
|
||||||
|
|
||||||
|
sendMailUrl;
|
||||||
|
|
||||||
lastIndexInformationLink;
|
lastIndexInformationLink;
|
||||||
showLastIndexInformationLink;
|
showLastIndexInformationLink;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue