import FipamoAdminAPI from '../../libraries/FipamoAdminAPI.js'; import Notficaton from '../ui/Notifications.js'; const notify = new Notficaton(); export default class Mailer { //-------------------------- // constructor //-------------------------- constructor() {} //-------------------------- // methods //-------------------------- sendMail(task = null, content = null) { let text = ''; if (task == 'TEST') { text = 'This is a test email'; } else { text = content; } let mailData = { content: text, mail_task: task }; let admin = new FipamoAdminAPI(); admin .sendMail(mailData) .then(result => { notify.alert(result.message, true); }) .catch(err => { notify.alert(err.message, false); }); } //-------------------------- // event handlers //-------------------------- }