From 36f1551b3359abc776596c6ac0e60ac10040a3de Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 20 Oct 2021 22:41:41 +0000 Subject: Print mail sent log messages. --- server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index 4e7f0aa..7ec15ba 100644 --- a/server.js +++ b/server.js @@ -1023,8 +1023,6 @@ const QUERY_LIST_UNSTARTED_GAMES = db.prepare("SELECT * FROM game_view WHERE sta function mail_callback(err, info) { if (err) console.log("MAIL ERROR", err); - else - console.log("MAIL SENT", info.envelope.to); } function mail_addr(user) { @@ -1046,6 +1044,7 @@ function mail_password_reset_token(user, token) { "Your password reset token is: " + token + "\n\n" + "https://rally-the-troops.com/reset_password/" + user.mail + "/" + token + "\n\n" + "If you did not request a password reset you can ignore this mail.\n"; + console.log("SENT MAIL:", mail_addr(user), subject); mailer.sendMail({ from: MAIL_FROM, to: mail_addr(user), subject: subject, text: body }, mail_callback); } @@ -1059,6 +1058,7 @@ function mail_your_turn_notification(user, game_id, interval) { "It's your turn.\n\n" + "https://rally-the-troops.com/play/" + game_id + "\n\n" + MAIL_FOOTER; + console.log("SENT MAIL:", mail_addr(user), subject); mailer.sendMail({ from: MAIL_FROM, to: mail_addr(user), subject: subject, text: body }, mail_callback); } } @@ -1077,6 +1077,7 @@ function mail_ready_to_start_notification(user, game_id, interval) { "Your game is ready to start.\n\n" + "https://rally-the-troops.com/join/" + game_id + "\n\n" + MAIL_FOOTER; + console.log("SENT MAIL:", mail_addr(user), subject); mailer.sendMail({ from: MAIL_FROM, to: mail_addr(user), subject: subject, text: body }, mail_callback); } } -- cgit v1.2.3