diff --git a/src/mail_templates/out_of_disk_space.ejs b/src/mail_templates/out_of_disk_space.ejs deleted file mode 100644 index a312311fa..000000000 --- a/src/mail_templates/out_of_disk_space.ejs +++ /dev/null @@ -1,22 +0,0 @@ -<%if (format === 'text') { %> - -Dear <%= cloudronName %> Admin, - -your server is running out of disk space. - -Disk space logs are attached. - -------------------------------------- - -<%- message %> - -------------------------------------- - - -Powered by https://cloudron.io - -Sent at: <%= new Date().toUTCString() %> - -<% } else { %> - -<% } %> diff --git a/src/mailer.js b/src/mailer.js index 6f5a48a22..7db8136dc 100644 --- a/src/mailer.js +++ b/src/mailer.js @@ -15,7 +15,6 @@ exports = module.exports = { appDied: appDied, oomEvent: oomEvent, - outOfDiskSpace: outOfDiskSpace, backupFailed: backupFailed, certificateRenewalError: certificateRenewalError, @@ -32,7 +31,6 @@ var assert = require('assert'), debug = require('debug')('box:mailer'), docker = require('./docker.js').connection, ejs = require('ejs'), - mail = require('./mail.js'), nodemailer = require('nodemailer'), path = require('path'), safe = require('safetydance'), @@ -440,24 +438,6 @@ function sendDigest(info) { }); } -function outOfDiskSpace(mailTo, message) { - assert.strictEqual(typeof mailTo, 'string'); - assert.strictEqual(typeof message, 'string'); - - getMailConfig(function (error, mailConfig) { - if (error) return debug('Error getting mail details:', error); - - var mailOptions = { - from: mailConfig.notificationFrom, - to: mailTo, - subject: util.format('[%s] Out of disk space alert', mailConfig.cloudronName), - text: render('out_of_disk_space.ejs', { cloudronName: mailConfig.cloudronName, message: message, format: 'text' }) - }; - - sendMails([ mailOptions ]); - }); -} - function backupFailed(error) { var message = splatchError(error); diff --git a/src/notifications.js b/src/notifications.js index 9ead6140b..37e647dc4 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -296,7 +296,6 @@ function diskSpaceWarning(message) { assert.strictEqual(typeof message, 'string'); actionForAllAdmins([], function (admin, callback) { - mailer.outOfDiskSpace(admin.email, message); upsert(admin.id, null, 'Out of Disk Space', message, '/#/graphs', callback); }, function (error) { if (error) console.error(error);