UNPKG

557 BJavaScriptView Raw
1const notifier = require('node-notifier');
2const mail = require('./mail');
3var preferencesDir = `${process.env['HOME']}/.0n/preferences.json`;
4var preferences = require(preferencesDir).mail;
5var native = require(preferencesDir).native;
6module.exports = function(obj) {
7 if (native) {
8 notifier.notify(obj.notify);
9 }
10 var mailConfig = {
11 username: preferences.username,
12 password: preferences.password,
13 to: preferences.to,
14 from: preferences.from,
15 text: 'Hello, your site gone down ✔',
16 site: obj.site
17 }
18 mail(mailConfig);
19};