diff options
Diffstat (limited to 'src/server/session_manager/crash_email.ts')
-rw-r--r-- | src/server/session_manager/crash_email.ts | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/server/session_manager/crash_email.ts b/src/server/session_manager/crash_email.ts deleted file mode 100644 index 7783cd779..000000000 --- a/src/server/session_manager/crash_email.ts +++ /dev/null @@ -1,36 +0,0 @@ -import * as nodemailer from "nodemailer"; -import { MailOptions } from "nodemailer/lib/json-transport"; - -export namespace CrashEmail { - - export async function dispatch(error: Error, recipients: string[]): Promise<boolean[]> { - const smtpTransport = nodemailer.createTransport({ - service: 'Gmail', - auth: { - user: 'brownptcdash@gmail.com', - pass: 'browngfx1' - } - }); - return Promise.all(recipients.map(recipient => new Promise<boolean>(resolve => { - const mailOptions = { - to: recipient, - from: 'brownptcdash@gmail.com', - subject: 'Dash Server Crash', - text: emailText(recipient, error) - } as MailOptions; - smtpTransport.sendMail(mailOptions, (dispatchError: Error | null) => resolve(dispatchError === null)); - }))); - } - - function emailText(recipient: string, { name, message, stack }: Error) { - return [ - `Hey ${recipient.split("@")[0]},`, - "You, as a Dash Administrator, are being notified of a server crash event. Here's what we know:", - `name:\n${name}`, - `message:\n${message}`, - `stack:\n${stack}`, - "The server is already restarting itself, but if you're concerned, use the Remote Desktop Connection to monitor progress." - ].join("\n\n"); - } - -}
\ No newline at end of file |