From b9a667b1262f17d4ab8fcde5196318123b1e0adb Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Mon, 22 Aug 2022 14:59:11 -0600 Subject: [PATCH] Add logs to weekly emails --- functions/src/weekly-markets-emails.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/functions/src/weekly-markets-emails.ts b/functions/src/weekly-markets-emails.ts index 1e43b7dc..881ba7ba 100644 --- a/functions/src/weekly-markets-emails.ts +++ b/functions/src/weekly-markets-emails.ts @@ -39,6 +39,11 @@ async function sendTrendingMarketsEmailsToAllUsers() { const privateUsersToSendEmailsTo = privateUsers.filter((user) => { return !user.unsubscribedFromWeeklyTrendingEmails }) + log( + 'Sending weekly trending emails to', + privateUsersToSendEmailsTo.length, + 'users' + ) const trendingContracts = (await getTrendingContracts()) .filter( (contract) => @@ -48,6 +53,10 @@ async function sendTrendingMarketsEmailsToAllUsers() { ) && (contract?.closeTime ?? 0) > Date.now() + DAY_MS ) .slice(0, 20) + log( + `Found ${trendingContracts.length} trending contracts:\n`, + trendingContracts.map((c) => c.question).join('\n ') + ) for (const privateUser of privateUsersToSendEmailsTo) { if (!privateUser.email) { log(`No email for ${privateUser.username}`)