diff --git a/src/mail_templates/box_update_available.ejs b/src/mail_templates/box_update_available.ejs deleted file mode 100644 index 16161f6ac..000000000 --- a/src/mail_templates/box_update_available.ejs +++ /dev/null @@ -1,55 +0,0 @@ -<%if (format === 'text') { %> - -Dear <%= cloudronName %> Admin, - -Version <%= newBoxVersion %> for Cloudron <%= fqdn %> is now available! - -Your Cloudron will update automatically tonight. Alternately, update immediately at <%= webadminUrl %>. - -Changelog: -<% for (var i = 0; i < changelog.length; i++) { %> - * <%- changelog[i] %> -<% } %> - -Thank you, -your Cloudron - -<% } else { %> - -
- - - -

Dear <%= cloudronName %> Admin,

- -
-

- Version <%= newBoxVersion %> for Cloudron <%= fqdn %> is now available! -

- -

- Your Cloudron will update automatically tonight.
- Alternately, update immediately here. -

- -
Changelog:
- - -
-
-
- -
- Powered by Cloudron. -
- -
- - - -<% } %> - diff --git a/src/mailer.js b/src/mailer.js index 5a9733f9f..05f21ea75 100644 --- a/src/mailer.js +++ b/src/mailer.js @@ -8,7 +8,6 @@ exports = module.exports = { userRemoved: userRemoved, adminChanged: adminChanged, passwordReset: passwordReset, - boxUpdateAvailable: boxUpdateAvailable, appUpdateAvailable: appUpdateAvailable, sendInvite: sendInvite, @@ -381,50 +380,6 @@ function appDied(app) { }); } -function boxUpdateAvailable(newBoxVersion, changelog) { - assert.strictEqual(typeof newBoxVersion, 'string'); - assert(util.isArray(changelog)); - - getAdminEmails(function (error, adminEmails) { - if (error) return console.log('Error getting admins', error); - - settings.getCloudronName(function (error, cloudronName) { - if (error) { - console.error(error); - cloudronName = 'Cloudron'; - } - - var converter = new showdown.Converter(); - - var templateData = { - fqdn: config.fqdn(), - webadminUrl: config.adminOrigin(), - newBoxVersion: newBoxVersion, - changelog: changelog, - changelogHTML: changelog.map(function (e) { return converter.makeHtml(e); }), - cloudronName: cloudronName, - cloudronAvatarUrl: config.adminOrigin() + '/api/v1/cloudron/avatar' - }; - - var templateDataText = JSON.parse(JSON.stringify(templateData)); - templateDataText.format = 'text'; - - var templateDataHTML = JSON.parse(JSON.stringify(templateData)); - templateDataHTML.format = 'html'; - - var mailOptions = { - from: mailConfig().from, - to: adminEmails.join(', '), - subject: util.format('%s has a new update available', config.fqdn()), - text: render('box_update_available.ejs', templateDataText), - html: render('box_update_available.ejs', templateDataHTML) - }; - - enqueue(mailOptions); - }); - }); -} - function appUpdateAvailable(app, updateInfo) { assert.strictEqual(typeof app, 'object'); assert.strictEqual(typeof updateInfo, 'object');