diff --git a/server/cleanupAccounts.js b/server/cleanupAccounts.js index 5e7c14ee..01a10762 100644 --- a/server/cleanupAccounts.js +++ b/server/cleanupAccounts.js @@ -48,7 +48,7 @@ async function warnInactive(db) { if (userRefreshed.bannedReason !== null) { continue; } - mailer(userRefreshed.email, 'inactivityWarning') + mailer(userRefreshed.email, 'inactivityWarning', {username: userRefreshed.username}); } catch (e) { console.error(e); } diff --git a/server/routes/admin.js b/server/routes/admin.js index 4570bf01..13d4c884 100644 --- a/server/routes/admin.js +++ b/server/routes/admin.js @@ -163,7 +163,7 @@ router.post('/admin/ban/:username', handleErrorAsync(async (req, res) => { WHERE id = ${user.id} `); await archiveBan(req.db, user); - mailer(user.email, 'ban', {reason: req.body.reason}); + mailer(user.email, 'ban', {reason: req.body.reason, username: normalise(req.params.username)}); } else { await req.db.get(SQL` UPDATE users diff --git a/src/mailer.js b/src/mailer.js index f36c2027..82a52364 100644 --- a/src/mailer.js +++ b/src/mailer.js @@ -72,6 +72,7 @@ const templates = {
[[ban.header]]
[[ban.reason]][[quotation.colon]] %reason%
[[quotation.start]]${terms}[[quotation.end]]
+@{{username}}
`, }, inactivityWarning: { @@ -84,6 +85,7 @@ const templates = { [[user.removeInactive.email.cta]] +@{{username}}
`, }, cardsWarning: {