show correct commission in market close emails
This commit is contained in:
parent
bbfdc923fb
commit
8313930c70
|
@ -419,8 +419,8 @@
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
A market you created has closed. It's attracted
|
A market you created has closed. It's attracted
|
||||||
<span style="font-weight: bold">{{pool}}</span> in
|
<span style="font-weight: bold">{{volume}}</span>
|
||||||
bets — congrats!
|
in bets — congrats!
|
||||||
<br
|
<br
|
||||||
style="
|
style="
|
||||||
font-family: 'Helvetica Neue', Helvetica,
|
font-family: 'Helvetica Neue', Helvetica,
|
||||||
|
@ -439,8 +439,8 @@
|
||||||
margin: 0;
|
margin: 0;
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
Resolve your market to earn {{creatorFee}}% of the
|
Resolve your market to earn {{creatorFee}} as the
|
||||||
profits as the creator commission.
|
creator commission.
|
||||||
<br
|
<br
|
||||||
style="
|
style="
|
||||||
font-family: 'Helvetica Neue', Helvetica,
|
font-family: 'Helvetica Neue', Helvetica,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { Bet } from '../../common/bet'
|
||||||
import { getProbability } from '../../common/calculate'
|
import { getProbability } from '../../common/calculate'
|
||||||
import { Comment } from '../../common/comment'
|
import { Comment } from '../../common/comment'
|
||||||
import { Contract, FreeResponseContract } from '../../common/contract'
|
import { Contract, FreeResponseContract } from '../../common/contract'
|
||||||
import { CREATOR_FEE } from '../../common/fees'
|
import { DPM_CREATOR_FEE } from '../../common/fees'
|
||||||
import { PrivateUser, User } from '../../common/user'
|
import { PrivateUser, User } from '../../common/user'
|
||||||
import { formatMoney, formatPercent } from '../../common/util/format'
|
import { formatMoney, formatPercent } from '../../common/util/format'
|
||||||
import { sendTemplateEmail, sendTextEmail } from './send-email'
|
import { sendTemplateEmail, sendTextEmail } from './send-email'
|
||||||
|
@ -149,8 +149,8 @@ export const sendMarketCloseEmail = async (
|
||||||
const { username, name, id: userId } = user
|
const { username, name, id: userId } = user
|
||||||
const firstName = name.split(' ')[0]
|
const firstName = name.split(' ')[0]
|
||||||
|
|
||||||
const { question, pool: pools, slug } = contract
|
const { question, slug, volume, mechanism, collectedFees } = contract
|
||||||
const pool = formatMoney(_.sum(_.values(pools)))
|
|
||||||
const url = `https://${DOMAIN}/${username}/${slug}`
|
const url = `https://${DOMAIN}/${username}/${slug}`
|
||||||
|
|
||||||
await sendTemplateEmail(
|
await sendTemplateEmail(
|
||||||
|
@ -158,12 +158,15 @@ export const sendMarketCloseEmail = async (
|
||||||
'Your market has closed',
|
'Your market has closed',
|
||||||
'market-close',
|
'market-close',
|
||||||
{
|
{
|
||||||
name: firstName,
|
|
||||||
question,
|
question,
|
||||||
pool,
|
|
||||||
url,
|
url,
|
||||||
userId,
|
userId,
|
||||||
creatorFee: (CREATOR_FEE * 100).toString(),
|
name: firstName,
|
||||||
|
volume: formatMoney(volume),
|
||||||
|
creatorFee:
|
||||||
|
mechanism === 'dpm-2'
|
||||||
|
? `${DPM_CREATOR_FEE * 100}% of the profits`
|
||||||
|
: formatMoney(collectedFees.creatorFee),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user