[nouns] notification emails for admins in db, not in .env
This commit is contained in:
parent
51390d8bac
commit
05468ff5aa
|
@ -18,10 +18,12 @@ async function notify() {
|
||||||
|
|
||||||
console.log('Entries awaiting moderation: ', awaitingModerationGrouped);
|
console.log('Entries awaiting moderation: ', awaitingModerationGrouped);
|
||||||
|
|
||||||
for (let admin of process.env.MAILER_ADMINS.split(',')) {
|
const admins = await db.all(`SELECT email FROM users WHERE roles = 'admin'`);
|
||||||
console.log('Sending email to ' + admin)
|
|
||||||
|
for (let { email } of admins) {
|
||||||
|
console.log('Sending email to ' + email)
|
||||||
mailer(
|
mailer(
|
||||||
admin,
|
email,
|
||||||
'[Pronouns] Dictionary entries awaiting moderation: ' + JSON.stringify(awaitingModerationGrouped),
|
'[Pronouns] Dictionary entries awaiting moderation: ' + JSON.stringify(awaitingModerationGrouped),
|
||||||
JSON.stringify(awaitingModerationGrouped)
|
JSON.stringify(awaitingModerationGrouped)
|
||||||
);
|
);
|
||||||
|
|
Reference in New Issue