diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-02-24 21:39:19 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-26 12:53:53 +0100 |
commit | ff59eb2239cadd10fb699ea13fe6630d5bd5cc88 (patch) | |
tree | d8ca2eb323dc747f99f636d9b1cfd1ed751a5212 | |
parent | 2f28467aed0a1be9e306f2987d5222cb0ad42d6c (diff) | |
download | server-ff59eb2239cadd10fb699ea13fe6630d5bd5cc88.tar.gz |
Put full game links in mail.
-rw-r--r-- | server.js | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1809,8 +1809,8 @@ function mail_game_info(game) { return desc + "\n" } -function mail_game_link(game_id, user) { - return SITE_URL + "/play/" + game_id + "/" + encodeURI(user.role) + "\n" +function mail_game_link(game, user) { + return SITE_URL + "/" + game.title_id + "/play.html?game=" + game.game_id + "&role=" + encodeURIComponent(user.role) + "\n" } function mail_password_reset_token(user, token) { @@ -1843,7 +1843,7 @@ function mail_game_started_notification(user, game_id) { let subject = `${game.title_name} #${game_id} (${user.role}) - Started!` let body = mail_game_info(game) + "The game has started!\n\n" + - mail_game_link(game_id, user) + + mail_game_link(game, user) + 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) @@ -1856,7 +1856,7 @@ function mail_game_over_notification(user, game_id, result, victory) { let subject = `${game.title_name} #${game_id} (${user.role}) - Finished!` let body = mail_game_info(game) + victory + "\n\n" + - mail_game_link(game_id, user) + + mail_game_link(game, user) + 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) @@ -1872,7 +1872,7 @@ function mail_your_turn_notification(user, game_id, interval) { let subject = `${game.title_name} #${game_id} (${user.role}) - Your turn!` let body = mail_game_info(game) + "It's your turn.\n\n" + - mail_game_link(game_id, user) + + mail_game_link(game, user) + 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) |