+
|
+
From de8c27c97086ac9373fecdae00823f2d0dab124d Mon Sep 17 00:00:00 2001
From: Ian Philips
+ Hi {{name}},
+ {{creatorName}}, (who you're following) just created a new market, check it out!
+ This e-mail has been sent to
+ {{name}},
+ click here to manage your notifications.
+
+ Hi {{name}},
+ Your market {{marketTitle}} just got its first prediction from a user!
+
+ Hi {{name}},
+ Your market {{marketTitle}} got predictions from a total of {{totalPredictors}} users!
+ 1}1yYx?r;fKYZ_o0-Q9I)ajWcz%UmF4558;vAs~hekUjk_PgH;e Y#2EagBxjAu%XH8E`E*!Tk1jl_ZD9f3PR+0meXg
zD
- Hi {{name}}, Thanks for
- using Manifold Markets. Running low
- on mana (M$)? Click the link below to receive a one time gift of M$500! Did
- you know, besides making correct predictions, there are
- plenty of other ways to earn mana? Cheers,
- David
- from Manifold
-
- Cheers, David from Manifold This e-mail has been sent to {{name}},
- click here to manage your notifications.
-
+
+
+
+
\ No newline at end of file
diff --git a/functions/src/emails.ts b/functions/src/emails.ts
index b9d34363..d1387ef9 100644
--- a/functions/src/emails.ts
+++ b/functions/src/emails.ts
@@ -56,10 +56,9 @@ export const sendMarketResolutionEmail = async (
? ` (plus ${formatMoney(creatorPayout)} in commissions)`
: ''
- const displayedInvestment =
- Number.isNaN(investment) || investment < 0
- ? formatMoney(0)
- : formatMoney(investment)
+ const correctedInvestment =
+ Number.isNaN(investment) || investment < 0 ? 0 : investment
+ const displayedInvestment = formatMoney(correctedInvestment)
const displayedPayout = formatMoney(payout)
@@ -81,7 +80,7 @@ export const sendMarketResolutionEmail = async (
return await sendTemplateEmail(
privateUser.email,
subject,
- 'market-resolved',
+ correctedInvestment === 0 ? 'market-resolved-no-bets' : 'market-resolved',
templateData
)
}
From 4398fa9bda37ec21d81023732c028d353b72c703 Mon Sep 17 00:00:00 2001
From: Ian Philips
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{creatorName}} asked
+
+
+
+
+
+ {{question}}
+
+
+
+
+
+
+ Resolved {{outcome}}
+
+
+
+
+
+
+
+
+
+
+ Dear {{name}},
+
+
+
+ A market you were following has been resolved!
+
+
+ Thanks,
+
+ Manifold Team
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ View market
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/functions/src/email-templates/new-unique-bettors.html b/functions/src/email-templates/new-unique-bettors.html
new file mode 100644
index 00000000..eb4c04e2
--- /dev/null
+++ b/functions/src/email-templates/new-unique-bettors.html
@@ -0,0 +1,501 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ We sent you a {{bonusString}} bonus for
+ creating a market that appeals to others, and we'll do so for each new predictor.
+
+
+ Keep up the good work and check out your newest predictor below!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/functions/src/emails.ts b/functions/src/emails.ts
index da6a5b41..adeb3d12 100644
--- a/functions/src/emails.ts
+++ b/functions/src/emails.ts
@@ -22,6 +22,7 @@ import {
notification_reason_types,
getDestinationsForUser,
} from '../../common/notification'
+import { Dictionary } from 'lodash'
export const sendMarketResolutionEmail = async (
reason: notification_reason_types,
@@ -544,3 +545,63 @@ export const sendNewFollowedMarketEmail = async (
}
)
}
+export const sendNewUniqueBettorsEmail = async (
+ reason: notification_reason_types,
+ userId: string,
+ privateUser: PrivateUser,
+ contract: Contract,
+ totalPredictors: number,
+ newPredictors: User[],
+ userBets: Dictionary<[Bet, ...Bet[]]>,
+ bonusAmount: number
+) => {
+ const { sendToEmail, urlToManageThisNotification: unsubscribeUrl } =
+ await getDestinationsForUser(privateUser, reason)
+ if (!privateUser.email || !sendToEmail) return
+ const user = await getUser(privateUser.id)
+ if (!user) return
+
+ const { name } = user
+ const firstName = name.split(' ')[0]
+ const creatorName = contract.creatorName
+ // make the emails stack for the same contract
+ const subject = `You made a popular market! ${
+ contract.question.length > 50
+ ? contract.question.slice(0, 50) + '...'
+ : contract.question
+ } just got ${
+ newPredictors.length
+ } new predictions. Check out who's betting on it inside.`
+ const templateData: Record
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ We sent you a {{bonusString}} bonus for getting {{newPredictors}} new predictors,
+ and we'll continue to do so for each new predictor, (although we won't send you any more emails about it for this market).
+
+
+ Keep up the good work and check out your newest predictors below!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{!isYou && (
diff --git a/functions/src/email-templates/market-resolved-no-bets.html b/functions/src/email-templates/market-resolved-no-bets.html
index ff5f541f..5d886adf 100644
--- a/functions/src/email-templates/market-resolved-no-bets.html
+++ b/functions/src/email-templates/market-resolved-no-bets.html
@@ -470,7 +470,7 @@
click here to manage your notifications.
+ " target="_blank">click here to unsubscribe from this type of notification.
diff --git a/functions/src/email-templates/market-resolved.html b/functions/src/email-templates/market-resolved.html
index de29a0f1..767202b6 100644
--- a/functions/src/email-templates/market-resolved.html
+++ b/functions/src/email-templates/market-resolved.html
@@ -502,7 +502,7 @@
click here to manage your notifications.
+ " target="_blank">click here to unsubscribe from this type of notification.
diff --git a/functions/src/email-templates/new-market-from-followed-user.html b/functions/src/email-templates/new-market-from-followed-user.html
index 877d554f..49633fb2 100644
--- a/functions/src/email-templates/new-market-from-followed-user.html
+++ b/functions/src/email-templates/new-market-from-followed-user.html
@@ -318,7 +318,7 @@
click here to manage your notifications.
+ " target="_blank">click here to unsubscribe from this type of notification.
)}
From a2d61a1daa2b3276c8e1d60682a0161db8d54593 Mon Sep 17 00:00:00 2001
From: mantikoros <95266179+mantikoros@users.noreply.github.com>
Date: Wed, 14 Sep 2022 03:52:31 -0500
Subject: [PATCH 18/37] Twitch integration (#815)
* twitch account linking; profile page twitch panel; twitch landing page
* fix import
* twitch logo
* save twitch credentials cloud function
* use user id instead of bot id, add manifold api endpoint
* properly add function to index
* Added support for new redirect Twitch auth.
* Added clean error handling in case of Twitch link fail.
* remove simulator
* Removed legacy non-redirect Twitch auth code. Added "add bot to channel" button in user profile and relevant data to user type.
* Removed unnecessary imports.
* Fixed line endings.
* Allow users to modify private user twitchInfo firestore object
* Local dev on savetwitchcredentials function
Co-authored-by: Phil
+
+
+
+
+ Yz3eNIpm0nQ*;ie{<-VK4~jruaGt{4b`s{H-MG8Gl0{+|U7HFb+?frB)a-
za(w#_|60@H2xv~l!!C*jm1A@0m!I%90Vj~=5%ya(2&k$f!5jj8r%%qhuNw
tQ6cJOWE#fzvS2sj)-yJK=C9bTPAL3R38cu`
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Claim M$500
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/functions/src/email-templates/market-comment.html b/functions/src/email-templates/market-comment.html
index 23e20dac..ce0669f1 100644
--- a/functions/src/email-templates/market-comment.html
+++ b/functions/src/email-templates/market-comment.html
@@ -369,7 +369,7 @@
click here to manage your notifications.
+ " target="_blank">click here to unsubscribe from this type of notification.
-
-
-
-
-
diff --git a/functions/src/email-templates/market-close.html b/functions/src/email-templates/market-close.html
index ee7976b0..4abd225e 100644
--- a/functions/src/email-templates/market-close.html
+++ b/functions/src/email-templates/market-close.html
@@ -487,7 +487,7 @@
click here to manage your notifications.
+ " target="_blank">click here to unsubscribe from this type of notification.
-
-
-
-
-
diff --git a/functions/src/email-templates/market-answer.html b/functions/src/email-templates/market-answer.html
index b2d7f727..e3d42b9d 100644
--- a/functions/src/email-templates/market-answer.html
+++ b/functions/src/email-templates/market-answer.html
@@ -369,7 +369,7 @@
click here to manage your notifications.
+ " target="_blank">click here to unsubscribe from this type of notification.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
|
+
Traders | +{BETTORS} | {bettorsCount} |