2024-03-19 22:34:01 +01:00
|
|
|
import FipamoAdminAPI from '../../libraries/FipamoAdminAPI.js';
|
|
|
|
import Notficaton from '../ui/Notifications.js';
|
2024-03-06 18:53:40 +01:00
|
|
|
const notify = new Notficaton();
|
|
|
|
export default class Mailer {
|
2024-03-19 22:34:01 +01:00
|
|
|
//--------------------------
|
|
|
|
// 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
|
|
|
|
//--------------------------
|
2024-03-06 18:53:40 +01:00
|
|
|
}
|