You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Fipamo/src/com/actions/Mailer.js

40 lines
828 B
JavaScript

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