Test sample of users' portfolios

This commit is contained in:
Ian Philips 2022-09-29 12:32:47 -04:00
parent cd7ddae133
commit 35aa6c0429
2 changed files with 9 additions and 8 deletions

View File

@ -648,8 +648,8 @@ export const sendWeeklyPortfolioUpdateEmail = async (
}) })
await sendTemplateEmail( await sendTemplateEmail(
privateUser.email, // privateUser.email,
// 'iansphilips@gmail.com', 'iansphilips@gmail.com',
`Here's your weekly portfolio update!`, `Here's your weekly portfolio update!`,
investments.length === 0 investments.length === 0
? 'portfolio-update-no-movers' ? 'portfolio-update-no-movers'

View File

@ -3,6 +3,7 @@ import * as admin from 'firebase-admin'
import { Contract, CPMMContract } from '../../common/contract' import { Contract, CPMMContract } from '../../common/contract'
import { import {
getAllPrivateUsers,
getPrivateUser, getPrivateUser,
getUser, getUser,
getValue, getValue,
@ -36,12 +37,12 @@ const firestore = admin.firestore()
export async function sendPortfolioUpdateEmailsToAllUsers() { export async function sendPortfolioUpdateEmailsToAllUsers() {
const privateUsers = isProd() const privateUsers = isProd()
? // ian & stephen's ids ? // ian & stephen's ids
filterDefined([ // filterDefined([
await getPrivateUser('AJwLWoo3xue32XIiAVrL5SyR1WB2'), // await getPrivateUser('AJwLWoo3xue32XIiAVrL5SyR1WB2'),
// await getPrivateUser('tlmGNz9kjXc2EteizMORes4qvWl2'), // await getPrivateUser('tlmGNz9kjXc2EteizMORes4qvWl2'),
]) // ])
: // await getAllPrivateUsers() await getAllPrivateUsers()
filterDefined([await getPrivateUser('6hHpzvRG0pMq8PNJs7RZj2qlZGn2')]) : filterDefined([await getPrivateUser('6hHpzvRG0pMq8PNJs7RZj2qlZGn2')])
// get all users that haven't unsubscribed from weekly emails // get all users that haven't unsubscribed from weekly emails
const privateUsersToSendEmailsTo = privateUsers const privateUsersToSendEmailsTo = privateUsers
.filter((user) => { .filter((user) => {