Don't send portfolio email to user less than 5 days old
This commit is contained in:
parent
1bc1debbe8
commit
c16e5189f7
|
@ -117,7 +117,8 @@ export async function sendPortfolioUpdateEmailsToAllUsers() {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
privateUsersToSendEmailsTo.map(async (privateUser) => {
|
privateUsersToSendEmailsTo.map(async (privateUser) => {
|
||||||
const user = await getUser(privateUser.id)
|
const user = await getUser(privateUser.id)
|
||||||
if (!user) return
|
// Don't send to a user unless they're over 5 days old
|
||||||
|
if (!user || user.createdTime > Date.now() - 5 * DAY_MS) return
|
||||||
const userBets = usersBets[privateUser.id] as Bet[]
|
const userBets = usersBets[privateUser.id] as Bet[]
|
||||||
const contractsUserBetOn = contractsUsersBetOn.filter((contract) =>
|
const contractsUserBetOn = contractsUsersBetOn.filter((contract) =>
|
||||||
userBets.some((bet) => bet.contractId === contract.id)
|
userBets.some((bet) => bet.contractId === contract.id)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user