send a message for cert renewal status
This commit is contained in:
@@ -20,6 +20,8 @@ exports = module.exports = {
|
||||
|
||||
outOfDiskSpace: outOfDiskSpace,
|
||||
|
||||
certificateRenewed: certificateRenewed,
|
||||
|
||||
FEEDBACK_TYPE_FEEDBACK: 'feedback',
|
||||
FEEDBACK_TYPE_TICKET: 'ticket',
|
||||
FEEDBACK_TYPE_APP_MISSING: 'app_missing',
|
||||
@@ -375,6 +377,20 @@ function outOfDiskSpace(message) {
|
||||
sendMails([ mailOptions ]);
|
||||
}
|
||||
|
||||
function certificateRenewed(domain, message) {
|
||||
assert.strictEqual(typeof domain, 'string');
|
||||
assert.strictEqual(typeof message, 'string');
|
||||
|
||||
var mailOptions = {
|
||||
from: config.adminEmail(),
|
||||
to: 'admin@cloudron.io',
|
||||
subject: util.format('[%s] Certificate was %s renewed', domain, message ? 'not' : ''),
|
||||
text: render('certificate_renewed.ejs', { domain: domain, message: message, format: 'text' })
|
||||
};
|
||||
|
||||
sendMails([ mailOptions ]);
|
||||
}
|
||||
|
||||
// this function bypasses the queue intentionally. it is also expected to work without the mailer module initialized
|
||||
// crashnotifier should be able to send mail when there is no db
|
||||
function sendCrashNotification(program, context) {
|
||||
|
||||
Reference in New Issue
Block a user