mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
fix types
This commit is contained in:
parent
1904feb048
commit
079df58c1a
@ -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;
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user