2018-11-09 16:48:01 +01:00
|
|
|
import {Injectable} from '@angular/core';
|
|
|
|
import {Http, Response, Headers, RequestOptions} from '@angular/http';
|
|
|
|
import {Email} from './email';
|
2018-11-14 12:20:26 +01:00
|
|
|
import {CustomOptions} from '../../services/servicesUtils/customOptions.class';
|
2018-11-09 16:48:01 +01:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class EmailService {
|
|
|
|
|
|
|
|
constructor(private http:Http) {
|
|
|
|
}
|
|
|
|
|
|
|
|
sendEmail(url: string, email: Email) {
|
|
|
|
let body = JSON.stringify(email);
|
|
|
|
|
2018-11-14 12:20:26 +01:00
|
|
|
return this.http.post(url, body, CustomOptions.getAuthOptionsWithBody())
|
2018-11-26 16:26:05 +01:00
|
|
|
.map(request => request.json());
|
2018-11-09 16:48:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|