fipamo/public/assets/scripts/dash/app/actions/Mailer.js

45 lines
996 B
JavaScript
Raw Normal View History

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
//--------------------------
}