Guest User

Untitled

a guest
Jun 13th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. export class EmailService {
  2. constructor(private http: HttpClient) {}
  3.  
  4. sendMailgunMessage() {
  5. const options = {
  6. headers: new HttpHeaders({
  7. 'Content-Type': 'application/x-www-form-urlencoded'
  8. })
  9. };
  10.  
  11. const body = {
  12. username: 'api',
  13. password: 'key-xxx',
  14. from: '<hello@app.xxx.com>',
  15. to: 'xxx@xxx.com',
  16. subject: 'Subject text',
  17. text: 'Body text',
  18. multipart: true
  19. };
  20.  
  21. return this.http.post('https://api.mailgun.net/v3/app.upsie.com/messages', body, options);
  22. }
  23. }
Add Comment
Please, Sign In to add comment