include creator payout in resolution emails
This commit is contained in:
parent
2c9e10c841
commit
cea957f1f9
|
@ -17,6 +17,7 @@ export const sendMarketResolutionEmail = async (
|
||||||
investment: number,
|
investment: number,
|
||||||
payout: number,
|
payout: number,
|
||||||
creator: User,
|
creator: User,
|
||||||
|
creatorPayout: number,
|
||||||
contract: Contract,
|
contract: Contract,
|
||||||
resolution: string,
|
resolution: string,
|
||||||
resolutionProbability?: number,
|
resolutionProbability?: number,
|
||||||
|
@ -42,6 +43,11 @@ export const sendMarketResolutionEmail = async (
|
||||||
|
|
||||||
const subject = `Resolved ${outcome}: ${contract.question}`
|
const subject = `Resolved ${outcome}: ${contract.question}`
|
||||||
|
|
||||||
|
const creatorPayoutText =
|
||||||
|
userId === creator.id
|
||||||
|
? ` (plus ${formatMoney(creatorPayout)} in commissions)`
|
||||||
|
: ''
|
||||||
|
|
||||||
const templateData: market_resolved_template = {
|
const templateData: market_resolved_template = {
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
|
@ -49,7 +55,7 @@ export const sendMarketResolutionEmail = async (
|
||||||
question: contract.question,
|
question: contract.question,
|
||||||
outcome,
|
outcome,
|
||||||
investment: `${Math.floor(investment)}`,
|
investment: `${Math.floor(investment)}`,
|
||||||
payout: `${Math.floor(payout)}`,
|
payout: `${Math.floor(payout)}${creatorPayoutText}`,
|
||||||
url: `https://${DOMAIN}/${creator.username}/${contract.slug}`,
|
url: `https://${DOMAIN}/${creator.username}/${contract.slug}`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,7 @@ export const resolveMarket = functions
|
||||||
openBets,
|
openBets,
|
||||||
userPayoutsWithoutLoans,
|
userPayoutsWithoutLoans,
|
||||||
creator,
|
creator,
|
||||||
|
creatorPayout,
|
||||||
contract,
|
contract,
|
||||||
outcome,
|
outcome,
|
||||||
resolutionProbability,
|
resolutionProbability,
|
||||||
|
@ -172,6 +173,7 @@ const sendResolutionEmails = async (
|
||||||
openBets: Bet[],
|
openBets: Bet[],
|
||||||
userPayouts: { [userId: string]: number },
|
userPayouts: { [userId: string]: number },
|
||||||
creator: User,
|
creator: User,
|
||||||
|
creatorPayout: number,
|
||||||
contract: Contract,
|
contract: Contract,
|
||||||
outcome: string,
|
outcome: string,
|
||||||
resolutionProbability?: number,
|
resolutionProbability?: number,
|
||||||
|
@ -201,6 +203,7 @@ const sendResolutionEmails = async (
|
||||||
investment,
|
investment,
|
||||||
payout,
|
payout,
|
||||||
creator,
|
creator,
|
||||||
|
creatorPayout,
|
||||||
contract,
|
contract,
|
||||||
outcome,
|
outcome,
|
||||||
resolutionProbability,
|
resolutionProbability,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user