Be more explicit after unsubscribing from weekly trending

This commit is contained in:
Ian Philips 2022-08-22 16:56:28 -06:00
parent 6929076740
commit 3bea983662
3 changed files with 6 additions and 2 deletions

View File

@ -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 () => {

View File

@ -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.`)
},
}

View File

@ -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()