Revision 53697
Added by Sofia Baltzi almost 6 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/email/body.ts | ||
---|---|---|
1 |
export class Body { |
|
2 |
salutation: string; |
|
3 |
fromMessage: string; |
|
4 |
fromName: string; |
|
5 |
paragraphs: string; |
|
6 |
closing: string |
|
7 |
signature: string; |
|
8 |
} |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/email/email.service.ts | ||
---|---|---|
1 |
import {Injectable} from '@angular/core'; |
|
2 |
import {Http, Response, Headers, RequestOptions} from '@angular/http'; |
|
3 |
import {Email} from './email'; |
|
4 |
|
|
5 |
@Injectable() |
|
6 |
export class EmailService { |
|
7 |
|
|
8 |
constructor(private http:Http) { |
|
9 |
} |
|
10 |
|
|
11 |
sendEmail(url: string, email: Email) { |
|
12 |
let headers = new Headers({'Content-Type': 'application/json'}); |
|
13 |
let options = new RequestOptions({headers: headers}); |
|
14 |
let body = JSON.stringify(email); |
|
15 |
|
|
16 |
console.log(body); |
|
17 |
|
|
18 |
return this.http.post(url, body, options) |
|
19 |
.do(request => console.log("Insert Response:"+request.status)); |
|
20 |
} |
|
21 |
|
|
22 |
} |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/email/email.ts | ||
---|---|---|
1 |
export class Email { |
|
2 |
body: string; |
|
3 |
subject: string; |
|
4 |
recipients: string[]; |
|
5 |
} |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/properties/env-properties.ts | ||
---|---|---|
131 | 131 |
searchLinkToAdvancedOrganizations; |
132 | 132 |
searchLinkToAdvancedPeople; |
133 | 133 |
|
134 |
sendMailUrl; |
|
135 |
|
|
134 | 136 |
lastIndexInformationLink; |
135 | 137 |
showLastIndexInformationLink; |
136 | 138 |
|
Also available in: Unified diff
Add email