forked from projects/fipamo
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
|
import FipamoAdminAPI from "../../libraries/FipamoAdminAPI";
|
||
|
import Notficaton from "../ui/Notifications";
|
||
|
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
|
||
|
//--------------------------
|
||
|
}
|