1 | const notifier = require('node-notifier');
|
2 | const mail = require('./mail');
|
3 | var preferencesDir = `${process.env['HOME']}/.0n/preferences.json`;
|
4 | var preferences = require(preferencesDir).mail;
|
5 | var native = require(preferencesDir).native;
|
6 | module.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 | };
|