Skip to content

Commit b6e19b9

Browse files
authored
Merge pull request #1886 from Mephistic/fix-org-email
Fallback to publicEmail for Org Users in Email notifications
2 parents 0bb7699 + a5dcc41 commit b6e19b9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

functions/src/notifications/deliverNotifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const deliverEmailNotifications = async () => {
6666
}
6767

6868
// Temporarily using email from the profile to test the non-auth issues
69-
const verifiedEmail = profile.email //await getVerifiedUserEmail(profileDoc.id)
69+
const verifiedEmail = profile.email || profile.contactInfo?.publicEmail //await getVerifiedUserEmail(profileDoc.id)
7070
if (!verifiedEmail) {
7171
console.log(
7272
`Skipping user ${profileDoc.id} because they have no verified email address`

functions/src/notifications/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,7 @@ export interface Profile {
6868
email?: string
6969
notificationFrequency?: Frequency
7070
nextDigestAt?: FirebaseFirestore.Timestamp
71+
contactInfo?: {
72+
publicEmail?: string
73+
}
7174
}

0 commit comments

Comments
 (0)