Skip to content

Commit f3530e7

Browse files
committed
fix(notifications): use fallback display name for null video names in first-view email
1 parent f587ef1 commit f3530e7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/web/lib/Notification.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,15 @@ export async function sendFirstViewEmail(
376376
? `https://cap.link/${params.videoId}`
377377
: `${serverEnv().WEB_URL}/s/${params.videoId}`;
378378

379+
const displayName = videoWithOwner.videoName || "Untitled Video";
380+
379381
await sendEmail({
380382
email: videoWithOwner.ownerEmail,
381-
subject: `Your Cap "${videoWithOwner.videoName}" just got its first view!`,
383+
subject: `Your Cap "${displayName}" just got its first view!`,
382384
react: FirstView({
383385
email: videoWithOwner.ownerEmail,
384386
url: videoUrl,
385-
videoName: videoWithOwner.videoName,
387+
videoName: displayName,
386388
viewerName,
387389
}),
388390
});

0 commit comments

Comments
 (0)