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

Function sendTo

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

Source from the content-addressed store, hash-verified

860 if (crosses80 && !isFreeUser) {
861 const ctaLink = billingSettingsLink
862 const sendTo = async (email: string, name?: string) => {
863 const prefs = await getEmailPreferences(email)
864 if (prefs?.unsubscribeAll || prefs?.unsubscribeNotifications) return
865
866 const html = await renderUsageThresholdEmail({
867 userName: name,
868 planName: params.planName,
869 percentUsed: Math.min(100, Math.round(params.percentAfter)),
870 currentUsage: params.currentUsageAfter,
871 limit: params.limit,
872 ctaLink,
873 })
874
875 await sendEmail({
876 to: email,
877 subject: getEmailSubject('usage-threshold'),
878 html,
879 emailType: 'notifications',
880 })
881 }
882
883 if (params.scope === 'user' && params.userId && params.userEmail) {
884 const rows = await db

Callers 1

Calls 4

getEmailPreferencesFunction · 0.90
sendEmailFunction · 0.90
getEmailSubjectFunction · 0.90

Tested by

no test coverage detected