diff --git a/common/user.ts b/common/user.ts
index 78b76511..2aeb7122 100644
--- a/common/user.ts
+++ b/common/user.ts
@@ -47,6 +47,7 @@ export const STARTING_BALANCE = ENV_CONFIG.startingBalance ?? 1000
// for sus users, i.e. multiple sign ups for same person
export const SUS_STARTING_BALANCE = ENV_CONFIG.startingBalance ?? 10
export const REFERRAL_AMOUNT = ENV_CONFIG.referralBonus ?? 500
+
export type PrivateUser = {
id: string // same as User.id
username: string // denormalized from User
@@ -56,6 +57,7 @@ export type PrivateUser = {
unsubscribedFromCommentEmails?: boolean
unsubscribedFromAnswerEmails?: boolean
unsubscribedFromGenericEmails?: boolean
+ manaBonusEmailSent?: boolean
initialDeviceToken?: string
initialIpAddress?: string
apiKey?: string
diff --git a/functions/package.json b/functions/package.json
index b20a8fd0..b0d8e458 100644
--- a/functions/package.json
+++ b/functions/package.json
@@ -31,6 +31,7 @@
"@tiptap/extension-link": "2.0.0-beta.43",
"@tiptap/extension-mention": "2.0.0-beta.102",
"@tiptap/starter-kit": "2.0.0-beta.190",
+ "dayjs": "1.11.4",
"cors": "2.8.5",
"express": "4.18.1",
"firebase-admin": "10.0.0",
diff --git a/functions/src/create-user.ts b/functions/src/create-user.ts
index 70e81055..c30e78c3 100644
--- a/functions/src/create-user.ts
+++ b/functions/src/create-user.ts
@@ -1,5 +1,7 @@
import * as admin from 'firebase-admin'
import { z } from 'zod'
+import { uniq } from 'lodash'
+
import {
MANIFOLD_AVATAR_URL,
MANIFOLD_USERNAME,
@@ -24,7 +26,6 @@ import {
import { track } from './analytics'
import { APIError, newEndpoint, validate } from './api'
import { Group, NEW_USER_GROUP_SLUGS } from '../../common/group'
-import { uniq } from 'lodash'
import {
DEV_HOUSE_LIQUIDITY_PROVIDER_ID,
HOUSE_LIQUIDITY_PROVIDER_ID,
@@ -93,8 +94,8 @@ export const createuser = newEndpoint(opts, async (req, auth) => {
await firestore.collection('private-users').doc(auth.uid).create(privateUser)
- await sendWelcomeEmail(user, privateUser)
await addUserToDefaultGroups(user)
+ await sendWelcomeEmail(user, privateUser)
await track(auth.uid, 'create user', { username }, { ip: req.ip })
return user
diff --git a/functions/src/email-templates/500-mana.html b/functions/src/email-templates/500-mana.html
index 5f0c450e..1ef9dbb7 100644
--- a/functions/src/email-templates/500-mana.html
+++ b/functions/src/email-templates/500-mana.html
@@ -1,12 +1,48 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+ Thanks for
+ using Manifold Markets. Running low
+ on mana (M$)? Click the link below to receive a one time gift of M$500!
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+ Cheers,
+ David from Manifold
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+ | |