@@ -715,18 +715,16 @@ export async function maybeSendUsageThresholdEmail(params: {
715715 const baseUrl = getBaseUrl ( )
716716 const isFreeUser = params . planName === 'Free'
717717
718- // Check for 80% threshold (all users)
718+ // Check for 80% threshold (paid users only — free users get a more specific email below )
719719 const crosses80 = params . percentBefore < 80 && params . percentAfter >= 80
720- // Check for 80% threshold (free users only)
721- const crosses80Free = params . percentBefore < 80 && params . percentAfter >= 80
722720 // Check for 100% threshold (free users only — credits exhausted)
723721 const crosses100 = params . percentBefore < 100 && params . percentAfter >= 100
724722
725723 // Skip if no thresholds crossed
726- if ( ! crosses80 && ! crosses80Free && ! crosses100 ) return
724+ if ( ! crosses80 && ! crosses100 ) return
727725
728- // For 80% threshold email (all users)
729- if ( crosses80 ) {
726+ // For 80% threshold email (paid users only )
727+ if ( crosses80 && ! isFreeUser ) {
730728 const ctaLink = `${ baseUrl } /workspace?billing=usage`
731729 const sendTo = async ( email : string , name ?: string ) => {
732730 const prefs = await getEmailPreferences ( email )
@@ -781,7 +779,7 @@ export async function maybeSendUsageThresholdEmail(params: {
781779 }
782780
783781 // For 80% threshold email (free users only)
784- if ( crosses80Free && isFreeUser ) {
782+ if ( crosses80 && isFreeUser ) {
785783 const upgradeLink = `${ baseUrl } /workspace?billing=upgrade`
786784 const sendFreeTierEmail = async ( email : string , name ?: string ) => {
787785 const prefs = await getEmailPreferences ( email )
0 commit comments