import DataUtils, {
	REQUEST_TYPE_POST,
	CONTENT_TYPE_JSON
} from '../../../../../brain//tools/utilities/DataUtils';
import * as DataEvent from '../../../../../brain/tools/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
	//--------------------------
}
