import DataUtils, { REQUEST_TYPE_POST, CONTENT_TYPE_JSON } from '../../../src/com/utils/DataUtils'; import * as DataEvent from '../../../src/com/events/DataEvent'; export default class Mailer { //-------------------------- // constructor //-------------------------- constructor() { this.dataUtils = new DataUtils(); } //-------------------------- // methods //-------------------------- sendMail() { var self = this; let mailData = { content: 'This is a test email' }; self.dataUtils .request( '/api/mail', DataEvent.SETTINGS_UPDATED, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, mailData ) .then(() => { //console.log(response); }) .catch(() => { //console.log(err); }); } //-------------------------- // event handlers //-------------------------- }