forked from projects/fipamo
ro
eda377aba3
with the setting page set up, now the the settings api can be added, beginning with the ability to render all files from settings. the base settings api class is set up, so now the rest of the methods can be added
45 lines
996 B
JavaScript
45 lines
996 B
JavaScript
import FipamoAdminAPI from '../../libraries/FipamoAdminAPI.js';
|
|
import Notficaton from '../ui/Notifications.js';
|
|
const notify = new Notficaton();
|
|
export default class Mailer {
|
|
//--------------------------
|
|
// constructor
|
|
//--------------------------
|
|
constructor() {}
|
|
//--------------------------
|
|
// methods
|
|
//--------------------------
|
|
sendMail() {
|
|
let mailData = {
|
|
content: 'This is a test email'
|
|
};
|
|
let admin = new FipamoAdminAPI();
|
|
admin
|
|
.sendMail(mailData)
|
|
.then(result => {
|
|
notify.alert(result.message, true);
|
|
})
|
|
.catch(err => {
|
|
notify.alert(err.message, false);
|
|
});
|
|
}
|
|
testMail() {
|
|
let mailData = {
|
|
content: 'This is a test email',
|
|
mail_task: 'TESTING'
|
|
};
|
|
let admin = new FipamoAdminAPI();
|
|
admin
|
|
.sendMail(mailData)
|
|
.then(result => {
|
|
notify.alert(result.message, true);
|
|
})
|
|
.catch(err => {
|
|
notify.alert(err.message, false);
|
|
});
|
|
}
|
|
//--------------------------
|
|
// event handlers
|
|
//--------------------------
|
|
}
|