mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-15 20:17:13 -04:00
Fix
This commit is contained in:
@@ -69,10 +69,10 @@ export const sendSearchNotifications: APIHandler<'send-search-notifications'> =
|
||||
matches[row.creator_id].matches.push({
|
||||
id: row.creator_id,
|
||||
description: {filters: row.search_filters, location: row.location},
|
||||
matches: [profiles.map((item: any) => ({
|
||||
matches: profiles.map((item: any) => ({
|
||||
name: item.name,
|
||||
username: item.username,
|
||||
}))],
|
||||
})),
|
||||
})
|
||||
}
|
||||
console.log(JSON.stringify(matches, null, 2))
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {PrivateUser, User} from 'common/user'
|
||||
import {getNotificationDestinationsForUser} from 'common/user-notification-preferences'
|
||||
import {sendEmail} from './send-email'
|
||||
import {NewMatchEmail} from '../new-match'
|
||||
import {NewMessageEmail} from '../new-message'
|
||||
import {NewEndorsementEmail} from '../new-endorsement'
|
||||
import {Test} from '../test'
|
||||
@@ -12,33 +11,33 @@ import NewSearchAlertsEmail from "email/new-search_alerts";
|
||||
|
||||
const from = 'Compass <no-reply@compassmeet.com>'
|
||||
|
||||
export const sendNewMatchEmail = async (
|
||||
privateUser: PrivateUser,
|
||||
matchedWithUser: User
|
||||
) => {
|
||||
const {sendToEmail, unsubscribeUrl} = getNotificationDestinationsForUser(
|
||||
privateUser,
|
||||
'new_match'
|
||||
)
|
||||
if (!privateUser.email || !sendToEmail) return
|
||||
const lover = await getLover(privateUser.id)
|
||||
if (!lover) return
|
||||
|
||||
return await sendEmail({
|
||||
from,
|
||||
subject: `You have a new match!`,
|
||||
to: privateUser.email,
|
||||
react: (
|
||||
<NewMatchEmail
|
||||
onUser={lover.user}
|
||||
email={privateUser.email}
|
||||
matchedWithUser={matchedWithUser}
|
||||
matchedLover={lover}
|
||||
unsubscribeUrl={unsubscribeUrl}
|
||||
/>
|
||||
),
|
||||
})
|
||||
}
|
||||
// export const sendNewMatchEmail = async (
|
||||
// privateUser: PrivateUser,
|
||||
// matchedWithUser: User
|
||||
// ) => {
|
||||
// const {sendToEmail, unsubscribeUrl} = getNotificationDestinationsForUser(
|
||||
// privateUser,
|
||||
// 'new_match'
|
||||
// )
|
||||
// if (!privateUser.email || !sendToEmail) return
|
||||
// const lover = await getLover(privateUser.id)
|
||||
// if (!lover) return
|
||||
//
|
||||
// return await sendEmail({
|
||||
// from,
|
||||
// subject: `You have a new match!`,
|
||||
// to: privateUser.email,
|
||||
// react: (
|
||||
// <NewMatchEmail
|
||||
// onUser={lover.user}
|
||||
// email={privateUser.email}
|
||||
// matchedWithUser={matchedWithUser}
|
||||
// matchedLover={lover}
|
||||
// unsubscribeUrl={unsubscribeUrl}
|
||||
// />
|
||||
// ),
|
||||
// })
|
||||
// }
|
||||
|
||||
export const sendNewMessageEmail = async (
|
||||
privateUser: PrivateUser,
|
||||
|
||||
@@ -13,7 +13,7 @@ export interface MatchesType {
|
||||
filters: any; // You might want to replace 'any' with a more specific type
|
||||
location: any; // You might want to replace 'any' with a more specific type
|
||||
};
|
||||
matches: any[]; // You might want to replace 'any' with a more specific type
|
||||
matches: MatchUser[]; // You might want to replace 'any' with a more specific type
|
||||
id: string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user