From 3bea9836620ad54cdf994155a20ba3e251612d76 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Mon, 22 Aug 2022 16:56:28 -0600 Subject: [PATCH] Be more explicit after unsubscribing from weekly trending --- functions/src/reset-weekly-emails-flag.ts | 2 +- functions/src/unsubscribe.ts | 4 ++++ functions/src/weekly-markets-emails.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/functions/src/reset-weekly-emails-flag.ts b/functions/src/reset-weekly-emails-flag.ts index fc6b396a..5a71b65b 100644 --- a/functions/src/reset-weekly-emails-flag.ts +++ b/functions/src/reset-weekly-emails-flag.ts @@ -4,7 +4,7 @@ import { getAllPrivateUsers } from './utils' export const resetWeeklyEmailsFlag = functions .runWith({ secrets: ['MAILGUN_KEY'] }) - // every Monday at 1 am PT (UTC -07:00) ( 12 hours before the emails will be sent) + // every Monday at 12 am PT (UTC -07:00) ( 12 hours before the emails will be sent) .pubsub.schedule('0 7 * * 1') .timeZone('Etc/UTC') .onRun(async () => { diff --git a/functions/src/unsubscribe.ts b/functions/src/unsubscribe.ts index 4db91539..da7b507f 100644 --- a/functions/src/unsubscribe.ts +++ b/functions/src/unsubscribe.ts @@ -69,6 +69,10 @@ export const unsubscribe: EndpointDefinition = { res.send( `${name}, you have been unsubscribed from market answer emails on Manifold Markets.` ) + else if (type === 'weekly-trending') + res.send( + `${name}, you have been unsubscribed from weekly trending emails on Manifold Markets.` + ) else res.send(`${name}, you have been unsubscribed.`) }, } diff --git a/functions/src/weekly-markets-emails.ts b/functions/src/weekly-markets-emails.ts index c7331dae..a20e40a2 100644 --- a/functions/src/weekly-markets-emails.ts +++ b/functions/src/weekly-markets-emails.ts @@ -10,7 +10,7 @@ import { DAY_MS } from '../../common/util/time' export const weeklyMarketsEmails = functions .runWith({ secrets: ['MAILGUN_KEY'] }) // every minute on Monday for an hour at 12pm PT (UTC -07:00) - .pubsub.schedule('* 18 * * 1') + .pubsub.schedule('* 19 * * 1') .timeZone('Etc/UTC') .onRun(async () => { await sendTrendingMarketsEmailsToAllUsers()