All emails use unsubscribeUrl

This commit is contained in:
Ian Philips 2022-09-12 10:30:16 -06:00
parent f3324ae7b7
commit f6bf2089e2
13 changed files with 22 additions and 20 deletions

View File

@ -96,6 +96,7 @@ export const createNotification = async (
if (!sendToEmail) continue if (!sendToEmail) continue
if (reason === 'your_contract_closed' && privateUser && sourceContract) { if (reason === 'your_contract_closed' && privateUser && sourceContract) {
// TODO: include number and names of bettors waiting for creator to resolve their market
await sendMarketCloseEmail( await sendMarketCloseEmail(
reason, reason,
sourceUser, sourceUser,
@ -287,6 +288,7 @@ export const createCommentOrAnswerOrUpdatedContractNotification = async (
} }
if (sendToEmail) { if (sendToEmail) {
if (sourceType === 'comment') { if (sourceType === 'comment') {
// TODO: change subject of email title to be more specific, i.e.: replied to you on/tagged you on/comment
await sendNewCommentEmail( await sendNewCommentEmail(
reason, reason,
privateUser, privateUser,

View File

@ -285,7 +285,7 @@
<div <div
style="font-family:Arial, sans-serif;font-size:11px;letter-spacing:normal;line-height:22px;text-align:center;color:#000000;"> style="font-family:Arial, sans-serif;font-size:11px;letter-spacing:normal;line-height:22px;text-align:center;color:#000000;">
<p style="margin: 10px 0;">This e-mail has been sent to {{name}}, <p style="margin: 10px 0;">This e-mail has been sent to {{name}},
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -490,7 +490,7 @@
"> ">
<p style="margin: 10px 0"> <p style="margin: 10px 0">
This e-mail has been sent to {{name}}, This e-mail has been sent to {{name}},
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -440,7 +440,7 @@
<p style="margin: 10px 0"> <p style="margin: 10px 0">
This e-mail has been sent to This e-mail has been sent to
{{name}}, {{name}},
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -526,7 +526,7 @@
" "
>our Discord</a >our Discord</a
>! Or, >! Or,
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -366,7 +366,7 @@
text-decoration: underline; text-decoration: underline;
margin: 0; margin: 0;
">our Discord</a>! Or, ">our Discord</a>! Or,
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -484,7 +484,7 @@
text-decoration: underline; text-decoration: underline;
margin: 0; margin: 0;
">our Discord</a>! Or, ">our Discord</a>! Or,
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -366,7 +366,7 @@
text-decoration: underline; text-decoration: underline;
margin: 0; margin: 0;
">our Discord</a>! Or, ">our Discord</a>! Or,
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -499,7 +499,7 @@
text-decoration: underline; text-decoration: underline;
margin: 0; margin: 0;
">our Discord</a>! Or, ">our Discord</a>! Or,
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -280,7 +280,7 @@
"> ">
<p style="margin: 10px 0"> <p style="margin: 10px 0">
This e-mail has been sent to {{name}}, This e-mail has been sent to {{name}},
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -215,7 +215,7 @@
style="font-family:Arial, sans-serif;font-size:11px;letter-spacing:normal;line-height:22px;text-align:center;color:#000000;"> style="font-family:Arial, sans-serif;font-size:11px;letter-spacing:normal;line-height:22px;text-align:center;color:#000000;">
<p style="margin: 10px 0;">This e-mail has been sent <p style="margin: 10px 0;">This e-mail has been sent
to {{name}}, to {{name}},
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -287,7 +287,7 @@
<div <div
style="font-family:Arial, sans-serif;font-size:11px;letter-spacing:normal;line-height:22px;text-align:center;color:#000000;"> style="font-family:Arial, sans-serif;font-size:11px;letter-spacing:normal;line-height:22px;text-align:center;color:#000000;">
<p style="margin: 10px 0;">This e-mail has been sent to {{name}}, <p style="margin: 10px 0;">This e-mail has been sent to {{name}},
<a href="{{unsubscribeLink}}" style=" <a href="{{unsubscribeUrl}}" style="
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
" target="_blank">click here to manage your notifications</a>. " target="_blank">click here to manage your notifications</a>.

View File

@ -153,7 +153,7 @@ export const sendWelcomeEmail = async (
const { name } = user const { name } = user
const firstName = name.split(' ')[0] const firstName = name.split(' ')[0]
const unsubscribeLink = `${DOMAIN}/notifications?tab=settings&section=${ const unsubscribeUrl = `${DOMAIN}/notifications?tab=settings&section=${
'onboarding_flow' as keyof notification_subscription_types 'onboarding_flow' as keyof notification_subscription_types
}` }`
@ -163,7 +163,7 @@ export const sendWelcomeEmail = async (
'welcome', 'welcome',
{ {
name: firstName, name: firstName,
unsubscribeLink, unsubscribeUrl,
}, },
{ {
from: 'David from Manifold <david@manifold.markets>', from: 'David from Manifold <david@manifold.markets>',
@ -221,7 +221,7 @@ export const sendOneWeekBonusEmail = async (
const { name } = user const { name } = user
const firstName = name.split(' ')[0] const firstName = name.split(' ')[0]
const unsubscribeLink = `${DOMAIN}/notifications?tab=settings&section=${ const unsubscribeUrl = `${DOMAIN}/notifications?tab=settings&section=${
'onboarding_flow' as keyof notification_subscription_types 'onboarding_flow' as keyof notification_subscription_types
}` }`
return await sendTemplateEmail( return await sendTemplateEmail(
@ -230,7 +230,7 @@ export const sendOneWeekBonusEmail = async (
'one-week', 'one-week',
{ {
name: firstName, name: firstName,
unsubscribeLink, unsubscribeUrl,
manalink: 'https://manifold.markets/link/lj4JbBvE', manalink: 'https://manifold.markets/link/lj4JbBvE',
}, },
{ {
@ -254,7 +254,7 @@ export const sendCreatorGuideEmail = async (
const { name } = user const { name } = user
const firstName = name.split(' ')[0] const firstName = name.split(' ')[0]
const unsubscribeLink = `${DOMAIN}/notifications?tab=settings&section=${ const unsubscribeUrl = `${DOMAIN}/notifications?tab=settings&section=${
'onboarding_flow' as keyof notification_subscription_types 'onboarding_flow' as keyof notification_subscription_types
}` }`
return await sendTemplateEmail( return await sendTemplateEmail(
@ -263,7 +263,7 @@ export const sendCreatorGuideEmail = async (
'creating-market', 'creating-market',
{ {
name: firstName, name: firstName,
unsubscribeLink, unsubscribeUrl,
}, },
{ {
from: 'David from Manifold <david@manifold.markets>', from: 'David from Manifold <david@manifold.markets>',
@ -288,7 +288,7 @@ export const sendThankYouEmail = async (
const { name } = user const { name } = user
const firstName = name.split(' ')[0] const firstName = name.split(' ')[0]
const unsubscribeLink = `${DOMAIN}/notifications?tab=settings&section=${ const unsubscribeUrl = `${DOMAIN}/notifications?tab=settings&section=${
'thank_you_for_purchases' as keyof notification_subscription_types 'thank_you_for_purchases' as keyof notification_subscription_types
}` }`
@ -298,7 +298,7 @@ export const sendThankYouEmail = async (
'thank-you', 'thank-you',
{ {
name: firstName, name: firstName,
unsubscribeLink, unsubscribeUrl,
}, },
{ {
from: 'David from Manifold <david@manifold.markets>', from: 'David from Manifold <david@manifold.markets>',
@ -479,7 +479,7 @@ export const sendInterestingMarketsEmail = async (
'interesting-markets', 'interesting-markets',
{ {
name: firstName, name: firstName,
unsubscribeLink: unsubscribeUrl, unsubscribeUrl,
question1Title: contractsToSend[0].question, question1Title: contractsToSend[0].question,
question1Link: contractUrl(contractsToSend[0]), question1Link: contractUrl(contractsToSend[0]),