sendMarketCloseEmail: handle unsubscribe
This commit is contained in:
parent
bf117aef46
commit
cbd8a7a790
|
@ -95,6 +95,13 @@ export const sendMarketCloseEmail = async (
|
||||||
privateUser: PrivateUser,
|
privateUser: PrivateUser,
|
||||||
contract: Contract
|
contract: Contract
|
||||||
) => {
|
) => {
|
||||||
|
if (
|
||||||
|
!privateUser ||
|
||||||
|
privateUser.unsubscribedFromResolutionEmails ||
|
||||||
|
!privateUser.email
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
const { username, name, id: userId } = user
|
const { username, name, id: userId } = user
|
||||||
const firstName = name.split(' ')[0]
|
const firstName = name.split(' ')[0]
|
||||||
|
|
||||||
|
@ -103,7 +110,7 @@ export const sendMarketCloseEmail = async (
|
||||||
const url = `https://manifold.markets/${username}/${slug}`
|
const url = `https://manifold.markets/${username}/${slug}`
|
||||||
|
|
||||||
await sendTemplateEmail(
|
await sendTemplateEmail(
|
||||||
privateUser.email || '',
|
privateUser.email,
|
||||||
'Your market has closed',
|
'Your market has closed',
|
||||||
'market-close',
|
'market-close',
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user