market resolution email: link in header image, show only non-negative investment amount

This commit is contained in:
mantikoros 2022-08-27 14:38:09 -05:00
parent 305acbb18f
commit eeed9eef10
2 changed files with 230 additions and 364 deletions

View File

@ -1,13 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html <html style="
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
" ">
>
<head> <head>
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Market resolved</title> <title>Market resolved</title>
@ -33,52 +32,60 @@
body { body {
padding: 0 !important; padding: 0 !important;
} }
h1 { h1 {
font-weight: 800 !important; font-weight: 800 !important;
margin: 20px 0 5px !important; margin: 20px 0 5px !important;
} }
h2 { h2 {
font-weight: 800 !important; font-weight: 800 !important;
margin: 20px 0 5px !important; margin: 20px 0 5px !important;
} }
h3 { h3 {
font-weight: 800 !important; font-weight: 800 !important;
margin: 20px 0 5px !important; margin: 20px 0 5px !important;
} }
h4 { h4 {
font-weight: 800 !important; font-weight: 800 !important;
margin: 20px 0 5px !important; margin: 20px 0 5px !important;
} }
h1 { h1 {
font-size: 22px !important; font-size: 22px !important;
} }
h2 { h2 {
font-size: 18px !important; font-size: 18px !important;
} }
h3 { h3 {
font-size: 16px !important; font-size: 16px !important;
} }
.container { .container {
padding: 0 !important; padding: 0 !important;
width: 100% !important; width: 100% !important;
} }
.content { .content {
padding: 0 !important; padding: 0 !important;
} }
.content-wrap { .content-wrap {
padding: 10px !important; padding: 10px !important;
} }
.invoice { .invoice {
width: 100% !important; width: 100% !important;
} }
} }
</style> </style>
</head> </head>
<body <body itemscope itemtype="http://schema.org/EmailMessage" style="
itemscope
itemtype="http://schema.org/EmailMessage"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
@ -89,43 +96,29 @@
line-height: 1.6em; line-height: 1.6em;
background-color: #f6f6f6; background-color: #f6f6f6;
margin: 0; margin: 0;
" " bgcolor="#f6f6f6">
bgcolor="#f6f6f6" <table class="body-wrap" style="
>
<table
class="body-wrap"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
width: 100%; width: 100%;
background-color: #f6f6f6; background-color: #f6f6f6;
margin: 0; margin: 0;
" " bgcolor="#f6f6f6">
bgcolor="#f6f6f6" <tr style="
>
<tr
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
" ">
> <td style="
<td
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
vertical-align: top; vertical-align: top;
margin: 0; margin: 0;
" " valign="top"></td>
valign="top" <td class="container" width="600" style="
></td>
<td
class="container"
width="600"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
@ -134,12 +127,8 @@
max-width: 600px !important; max-width: 600px !important;
clear: both !important; clear: both !important;
margin: 0 auto; margin: 0 auto;
" " valign="top">
valign="top" <div class="content" style="
>
<div
class="content"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
@ -147,14 +136,8 @@
display: block; display: block;
margin: 0 auto; margin: 0 auto;
padding: 20px; padding: 20px;
" ">
> <table class="main" width="100%" cellpadding="0" cellspacing="0" style="
<table
class="main"
width="100%"
cellpadding="0"
cellspacing="0"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
@ -162,20 +145,14 @@
background-color: #fff; background-color: #fff;
margin: 0; margin: 0;
border: 1px solid #e9e9e9; border: 1px solid #e9e9e9;
" " bgcolor="#fff">
bgcolor="#fff" <tr style="
>
<tr
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
" ">
> <td class="content-wrap aligncenter" style="
<td
class="content-wrap aligncenter"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
@ -183,35 +160,23 @@
text-align: center; text-align: center;
margin: 0; margin: 0;
padding: 20px; padding: 20px;
" " align="center" valign="top">
align="center" <table width="100%" cellpadding="0" cellspacing="0" style="
valign="top"
>
<table
width="100%"
cellpadding="0"
cellspacing="0"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
width: 90%; width: 90%;
" ">
> <tr style="
<tr
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
" ">
> <td class="content-block" style="
<td
class="content-block"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -220,30 +185,22 @@
margin: 0; margin: 0;
padding: 0 0 40px 0; padding: 0 0 40px 0;
text-align: left; text-align: left;
" " valign="top">
valign="top" <a href="https://manifold.markets" target="_blank">
> <img src="https://manifold.markets/logo-banner.png" width="300" style="height: auto"
<img alt="Manifold Markets" />
src="https://manifold.markets/logo-banner.png" </a>
width="300"
style="height: auto"
alt="Manifold Markets"
/>
</td> </td>
</tr> </tr>
<tr <tr style="
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
padding: 0; padding: 0;
" ">
> <td class="content-block" style="
<td
class="content-block"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -252,24 +209,18 @@
margin: 0; margin: 0;
padding: 0 0 6px 0; padding: 0 0 6px 0;
text-align: left; text-align: left;
" " valign="top">
valign="top"
>
{{creatorName}} asked {{creatorName}} asked
</td> </td>
</tr> </tr>
<tr <tr style="
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
" ">
> <td class="content-block" style="
<td
class="content-block"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -277,12 +228,8 @@
vertical-align: top; vertical-align: top;
margin: 0; margin: 0;
padding: 0 0 20px; padding: 0 0 20px;
" " valign="top">
valign="top" <a href="{{url}}" style="
>
<a
href="{{url}}"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
'Lucida Grande', sans-serif; 'Lucida Grande', sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -295,24 +242,18 @@
color: #4337c9; color: #4337c9;
display: block; display: block;
text-decoration: none; text-decoration: none;
" ">
> {{question}}</a>
{{question}}</a
>
</td> </td>
</tr> </tr>
<tr <tr style="
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
" ">
> <td class="content-block" style="
<td
class="content-block"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -320,12 +261,8 @@
vertical-align: top; vertical-align: top;
margin: 0; margin: 0;
padding: 0 0 0px; padding: 0 0 0px;
" " valign="top">
valign="top" <h2 class="aligncenter" style="
>
<h2
class="aligncenter"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
'Lucida Grande', sans-serif; 'Lucida Grande', sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -335,25 +272,19 @@
font-weight: 500; font-weight: 500;
text-align: center; text-align: center;
margin: 10px 0 0; margin: 10px 0 0;
" " align="center">
align="center"
>
Resolved {{outcome}} Resolved {{outcome}}
</h2> </h2>
</td> </td>
</tr> </tr>
<tr <tr style="
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" ">
> <td class="content-block aligncenter" style="
<td
class="content-block aligncenter"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -362,13 +293,8 @@
text-align: center; text-align: center;
margin: 0; margin: 0;
padding: 0; padding: 0;
" " align="center" valign="top">
align="center" <table class="invoice" style="
valign="top"
>
<table
class="invoice"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -376,19 +302,15 @@
text-align: left; text-align: left;
width: 80%; width: 80%;
margin: 40px auto; margin: 40px auto;
" ">
> <tr style="
<tr
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" ">
> <td style="
<td
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -396,138 +318,105 @@
vertical-align: top; vertical-align: top;
margin: 0; margin: 0;
padding: 5px 0; padding: 5px 0;
" " valign="top">
valign="top"
>
Dear {{name}}, Dear {{name}},
<br <br style="
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/> <br style="
<br
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/>
A market you bet in has been resolved! A market you bet in has been resolved!
<br <br style="
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/> <br style="
<br
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/>
Your investment was Your investment was
<span style="font-weight: bold" <span style="font-weight: bold">{{investment}}</span>.
>M$ {{investment}}</span <br style="
>.
<br
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/> <br style="
<br
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/>
Your payout is Your payout is
<span style="font-weight: bold" <span style="font-weight: bold">{{payout}}</span>.
>M$ {{payout}}</span <br style="
>.
<br
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/> <br style="
<br
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/>
Thanks, Thanks,
<br <br style="
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/>
Manifold Team Manifold Team
<br <br style="
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/> <br style="
<br
style="
font-family: 'Helvetica Neue', Helvetica, font-family: 'Helvetica Neue', Helvetica,
Arial, sans-serif; Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" " />
/>
</td> </td>
</tr> </tr>
<tr <tr style="
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
" ">
>
<td style="padding: 10px 0 0 0; margin: 0"> <td style="padding: 10px 0 0 0; margin: 0">
<div align="center"> <div align="center">
<!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 0; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;font-family:arial,helvetica,sans-serif;"><tr><td style="font-family:arial,helvetica,sans-serif;" align="center"><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="" style="height:37px; v-text-anchor:middle; width:110px;" arcsize="11%" stroke="f" fillcolor="#3AAEE0"><w:anchorlock/><center style="color:#FFFFFF;font-family:arial,helvetica,sans-serif;"><![endif]--> <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 0; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;font-family:arial,helvetica,sans-serif;"><tr><td style="font-family:arial,helvetica,sans-serif;" align="center"><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="" style="height:37px; v-text-anchor:middle; width:110px;" arcsize="11%" stroke="f" fillcolor="#3AAEE0"><w:anchorlock/><center style="color:#FFFFFF;font-family:arial,helvetica,sans-serif;"><![endif]-->
<a <a href="{{url}}" target="_blank" style="
href="{{url}}"
target="_blank"
style="
box-sizing: border-box; box-sizing: border-box;
display: inline-block; display: inline-block;
font-family: arial, helvetica, sans-serif; font-family: arial, helvetica, sans-serif;
@ -545,23 +434,16 @@
word-break: break-word; word-break: break-word;
word-wrap: break-word; word-wrap: break-word;
mso-border-alt: none; mso-border-alt: none;
" ">
> <span style="
<span
style="
display: block; display: block;
padding: 10px 20px; padding: 10px 20px;
line-height: 120%; line-height: 120%;
" "><span style="
><span
style="
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
line-height: 18.8px; line-height: 18.8px;
" ">View market</span></span>
>View market</span
></span
>
</a> </a>
<!--[if mso]></center></v:roundrect></td></tr></table><![endif]--> <!--[if mso]></center></v:roundrect></td></tr></table><![endif]-->
</div> </div>
@ -574,9 +456,7 @@
</td> </td>
</tr> </tr>
</table> </table>
<div <div class="footer" style="
class="footer"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
@ -585,28 +465,20 @@
color: #999; color: #999;
margin: 0; margin: 0;
padding: 20px; padding: 20px;
" ">
> <table width="100%" style="
<table
width="100%"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
" ">
> <tr style="
<tr
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
" ">
> <td class="aligncenter content-block" style="
<td
class="aligncenter content-block"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -616,14 +488,9 @@
text-align: center; text-align: center;
margin: 0; margin: 0;
padding: 0 0 20px; padding: 0 0 20px;
" " align="center" valign="top">
align="center"
valign="top"
>
Questions? Come ask in Questions? Come ask in
<a <a href="https://discord.gg/eHQBNBqXuh" style="
href="https://discord.gg/eHQBNBqXuh"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -631,12 +498,8 @@
color: #999; color: #999;
text-decoration: underline; text-decoration: underline;
margin: 0; margin: 0;
" ">our Discord</a>! Or,
>our Discord</a <a href="{{unsubscribeUrl}}" style="
>! Or,
<a
href="{{unsubscribeUrl}}"
style="
font-family: 'Helvetica Neue', Helvetica, Arial, font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; sans-serif;
box-sizing: border-box; box-sizing: border-box;
@ -644,26 +507,22 @@
color: #999; color: #999;
text-decoration: underline; text-decoration: underline;
margin: 0; margin: 0;
" ">unsubscribe</a>.
>unsubscribe</a
>.
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</td> </td>
<td <td style="
style="
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
vertical-align: top; vertical-align: top;
margin: 0; margin: 0;
" " valign="top"></td>
valign="top"
></td>
</tr> </tr>
</table> </table>
</body> </body>
</html> </html>

View File

@ -53,22 +53,29 @@ export const sendMarketResolutionEmail = async (
const subject = `Resolved ${outcome}: ${contract.question}` const subject = `Resolved ${outcome}: ${contract.question}`
// const creatorPayoutText = const creatorPayoutText =
// userId === creator.id creatorPayout >= 1 && userId === creator.id
// ? ` (plus ${formatMoney(creatorPayout)} in commissions)` ? ` (plus ${formatMoney(creatorPayout)} in commissions)`
// : '' : ''
const emailType = 'market-resolved' const emailType = 'market-resolved'
const unsubscribeUrl = `${UNSUBSCRIBE_ENDPOINT}?id=${userId}&type=${emailType}` const unsubscribeUrl = `${UNSUBSCRIBE_ENDPOINT}?id=${userId}&type=${emailType}`
const displayedInvestment =
Number.isNaN(investment) || investment < 0
? formatMoney(0)
: formatMoney(investment)
const displayedPayout = formatMoney(payout)
const templateData: market_resolved_template = { const templateData: market_resolved_template = {
userId: user.id, userId: user.id,
name: user.name, name: user.name,
creatorName: creator.name, creatorName: creator.name,
question: contract.question, question: contract.question,
outcome, outcome,
investment: `${Math.floor(investment)}`, investment: displayedInvestment,
payout: `${Math.floor(payout)}`, payout: displayedPayout + creatorPayoutText,
url: `https://${DOMAIN}/${creator.username}/${contract.slug}`, url: `https://${DOMAIN}/${creator.username}/${contract.slug}`,
unsubscribeUrl, unsubscribeUrl,
} }