From 106dc232b8fb25a776dc897b757a15ba6abaa769 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Tue, 20 Sep 2022 16:03:09 -0500 Subject: [PATCH] send market guide onboarding email after 96 hrs --- functions/src/on-create-user.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/functions/src/on-create-user.ts b/functions/src/on-create-user.ts index 03c6dda0..71425f2c 100644 --- a/functions/src/on-create-user.ts +++ b/functions/src/on-create-user.ts @@ -26,18 +26,12 @@ export const onCreateUser = functions const followupSendTime = dayjs().add(48, 'hours').toString() await sendPersonalFollowupEmail(user, privateUser, followupSendTime) - const day = dayjs().utc().day() - - const skipInterestingMarkets = - // skip email if weekly email is about to go out - day === 0 || (day === 1 && dayjs().utc().hour() <= 19) - - const guideSendTime = dayjs() - .add(skipInterestingMarkets ? 24 : 96, 'hours') - .toString() + const guideSendTime = dayjs().add(96, 'hours').toString() await sendCreatorGuideEmail(user, privateUser, guideSendTime) - if (skipInterestingMarkets) return + // skip email if weekly email is about to go out + const day = dayjs().utc().day() + if (day === 0 || (day === 1 && dayjs().utc().hour() <= 19)) return const contracts = await getTrendingContracts() const marketsSendTime = dayjs().add(24, 'hours').toString()