From 2f873d9b67372532c85d7276bc323007b0af67f7 Mon Sep 17 00:00:00 2001 From: cgeek Date: Tue, 11 Jun 2019 13:50:02 +0200 Subject: [PATCH] [enh] hostname in mails body as well --- src/lib/mail.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/mail.ts b/src/lib/mail.ts index e66d2ca..d411ef4 100644 --- a/src/lib/mail.ts +++ b/src/lib/mail.ts @@ -36,7 +36,7 @@ export const mail = { console.log('Connection established') await sendMail(conf.mail, `[dwatcher] [${os.hostname}] Connection established`, `

- Connection to ${target} established on ${moment().format('DD-MM-YYYY HH:mm:ss')}. + Connection from [${os.hostname}] to ${target} established on ${moment().format('DD-MM-YYYY HH:mm:ss')}.

`) } @@ -48,7 +48,7 @@ export const mail = { console.log('Waiting %s seconds...', waitingDelay) await sendMail(conf.mail, `[dwatcher] [${os.hostname}] Connection closed`, `

- Connection to ${target} was lost on ${moment().format('dd-MM-YYYY HH:mm:ss')}. + Connection from [${os.hostname}] to ${target} was lost on ${moment().format('dd-MM-YYYY HH:mm:ss')}.

Waiting ${(waitingDelay / 1000).toFixed(0)} seconds before trying to reconnect. @@ -62,7 +62,7 @@ export const mail = { console.log('Connection recovered') await sendMail(conf.mail, `[dwatcher] [${os.hostname}] Connection recovered`, `

- Connection to ${target} was recovered on ${moment().format('dd-MM-YYYY HH:mm:ss')}. + Connection from [${os.hostname}] to ${target} was recovered on ${moment().format('dd-MM-YYYY HH:mm:ss')}.

`) } @@ -73,7 +73,7 @@ export const mail = { console.error(e.message || e) // await sendMail(conf.mail, `[dwatcher] Connection error`, ` //

- // Connection error with ${target} on ${moment().format('dd-MM-YYYY HH:mm:ss')}: + // Connection from [${os.hostname}] error with ${target} on ${moment().format('dd-MM-YYYY HH:mm:ss')}: //

//

// ${e.message}