diff --git a/server/study-helpers.js b/server/study-helpers.js index 67b4c5e..6ef2de4 100644 --- a/server/study-helpers.js +++ b/server/study-helpers.js @@ -638,12 +638,14 @@ export async function scheduleStudyReminders(sendStudyReminderEmail) { const sectionId = section.id const releaseDate = getSectionReleaseDate(section) if (!releaseDate) continue - if (releaseDate > now) continue + // Lessons release at 1:00 AM; reminder emails go out 8 hours later, at 9:00 AM the same day. + const sendDate = new Date(releaseDate.getTime() + 8 * 60 * 60 * 1000) + if (sendDate > now) continue const sentForStudy = Array.isArray(userSent[studySlug]) ? userSent[studySlug] : [] if (sentForStudy.includes(sectionId)) continue - const hoursSinceRelease = (now.getTime() - releaseDate.getTime()) / (1000 * 60 * 60) - if (hoursSinceRelease > 24) continue + const hoursSinceSend = (now.getTime() - sendDate.getTime()) / (1000 * 60 * 60) + if (hoursSinceSend > 24) continue const canonical = state.cachedSiteContent?.seo?.canonicalUrl || 'https://versebyversewithnate.us/' const base = canonical.endsWith('/') ? canonical.slice(0, -1) : canonical