import {HttpService} from "../http/http.service"; import {Injectable} from "@angular/core"; import {UtilsConfig} from "../utils.config"; @Injectable() export class EmailService { constructor(private httpService: HttpService, public config: UtilsConfig) {} sendPrettyEmail(args: SendEmailArgs) { args.content = `
${args.content}
`; return this.sendRawEmail(args); } sendRawEmail(args: SendEmailArgs) { console.log('Sending Email'); return this.httpService.performRequest({ method: 'post', url: this.config.emailUrl || 'https://us-central1-eatmatic-143319.cloudfunctions.net/httpGenericEmail', body: args }); } } export class SendEmailArgs { to: string; from: string; subject: string; content: string; }