[mailer] include username in ban and inactivityWarning
This commit is contained in:
parent
f35290f51e
commit
f50ae61a86
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -72,6 +72,7 @@ const templates = {
|
|||
<p>[[ban.header]]</p>
|
||||
<p>[[ban.reason]][[quotation.colon]] %reason%</p>
|
||||
<p style="font-size: 12px; color: #777">[[quotation.start]]${terms}[[quotation.end]]</p>
|
||||
<p style="color: #999; font-size: 10px;">@{{username}}</p>
|
||||
`,
|
||||
},
|
||||
inactivityWarning: {
|
||||
|
@ -84,6 +85,7 @@ const templates = {
|
|||
[[user.removeInactive.email.cta]]
|
||||
</a>
|
||||
</p>
|
||||
<p style="color: #999; font-size: 10px;">@{{username}}</p>
|
||||
`,
|
||||
},
|
||||
cardsWarning: {
|
||||
|
|
Reference in New Issue