MCPcopy Index your code
hub / github.com/simstudioai/sim / sendExhaustedEmail

Function sendExhaustedEmail

apps/sim/lib/billing/core/usage.ts:959–981  ·  view source on GitHub ↗
(email: string, name?: string)

Source from the content-addressed store, hash-verified

957 if (crosses100 && isFreeUser) {
958 const upgradeLink = upgradeCreditsLink
959 const sendExhaustedEmail = async (email: string, name?: string) => {
960 const prefs = await getEmailPreferences(email)
961 if (prefs?.unsubscribeAll || prefs?.unsubscribeNotifications) return
962
963 const html = await renderCreditsExhaustedEmail({
964 userName: name,
965 limit: params.limit,
966 upgradeLink,
967 })
968
969 await sendEmail({
970 to: email,
971 subject: getEmailSubject('free-tier-exhausted'),
972 html,
973 emailType: 'notifications',
974 })
975
976 logger.info('Free tier credits exhausted email sent', {
977 email,
978 currentUsage: params.currentUsageAfter,
979 limit: params.limit,
980 })
981 }
982
983 if (params.scope === 'user' && params.userId && params.userEmail) {
984 const rows = await db

Callers 1

Calls 5

getEmailPreferencesFunction · 0.90
sendEmailFunction · 0.90
getEmailSubjectFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected