diff --git a/apps/backend/src/lib/email-rendering.tsx b/apps/backend/src/lib/email-rendering.tsx index e6a493f93..c053e5bf0 100644 --- a/apps/backend/src/lib/email-rendering.tsx +++ b/apps/backend/src/lib/email-rendering.tsx @@ -9,8 +9,8 @@ import { deindent } from "@stackframe/stack-shared/dist/utils/strings"; import { Tenancy } from './tenancies'; export function getActiveEmailTheme(tenancy: Tenancy) { - const themeList = tenancy.completeConfig.emails.themes; - const currentActiveTheme = tenancy.completeConfig.emails.selectedThemeId; + const themeList = tenancy.config.emails.themes; + const currentActiveTheme = tenancy.config.emails.selectedThemeId; if (!(has(themeList, currentActiveTheme))) { throw new StackAssertionError("No active email theme found", { themeList, @@ -21,7 +21,7 @@ export function getActiveEmailTheme(tenancy: Tenancy) { } export function getEmailThemeForTemplate(tenancy: Tenancy, templateThemeId: string | null | false | undefined) { - const themeList = tenancy.completeConfig.emails.themes; + const themeList = tenancy.config.emails.themes; if (templateThemeId && has(themeList, templateThemeId)) { return get(themeList, templateThemeId).tsxSource; } diff --git a/apps/backend/src/lib/emails.tsx b/apps/backend/src/lib/emails.tsx index b9faa7b40..ec7612cd2 100644 --- a/apps/backend/src/lib/emails.tsx +++ b/apps/backend/src/lib/emails.tsx @@ -1,5 +1,6 @@ import { getPrismaClientForTenancy } from '@/prisma-client'; import { traceSpan } from '@/utils/telemetry'; +import { DEFAULT_TEMPLATE_IDS } from '@stackframe/stack-shared/dist/helpers/emails'; import { UsersCrud } from '@stackframe/stack-shared/dist/interface/crud/users'; import { getEnvVariable } from '@stackframe/stack-shared/dist/utils/env'; import { StackAssertionError, StatusError, captureError } from '@stackframe/stack-shared/dist/utils/errors'; @@ -7,13 +8,12 @@ import { filterUndefined, omit, pick } from '@stackframe/stack-shared/dist/utils import { runAsynchronously, wait } from '@stackframe/stack-shared/dist/utils/promises'; import { Result } from '@stackframe/stack-shared/dist/utils/results'; import nodemailer from 'nodemailer'; -import { Tenancy, getTenancy } from './tenancies'; import { getEmailThemeForTemplate, renderEmailWithTemplate } from './email-rendering'; -import { DEFAULT_TEMPLATE_IDS } from '@stackframe/stack-shared/dist/helpers/emails'; +import { Tenancy, getTenancy } from './tenancies'; function getDefaultEmailTemplate(tenancy: Tenancy, type: keyof typeof DEFAULT_TEMPLATE_IDS) { - const templateList = new Map(Object.entries(tenancy.completeConfig.emails.templates)); + const templateList = new Map(Object.entries(tenancy.config.emails.templates)); const defaultTemplateIdsMap = new Map(Object.entries(DEFAULT_TEMPLATE_IDS)); const defaultTemplateId = defaultTemplateIdsMap.get(type); if (defaultTemplateId) {