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