Skip to content

Commit 93885e3

Browse files
committed
pass the resend api key as env to the preview server
1 parent 401108d commit 93885e3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/react-email/src/utils/preview/get-env-variables-for-preview-app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ export const getEnvVariablesForPreviewApp = (
44
relativePathToEmailsDirectory: string,
55
previewServerLocation: string,
66
cwd: string,
7+
resendApiKey?: string,
78
) => {
89
return {
910
EMAILS_DIR_RELATIVE_PATH: relativePathToEmailsDirectory,
1011
EMAILS_DIR_ABSOLUTE_PATH: path.resolve(cwd, relativePathToEmailsDirectory),
1112
PREVIEW_SERVER_LOCATION: previewServerLocation,
1213
USER_PROJECT_LOCATION: cwd,
14+
RESEND_API_KEY: resendApiKey,
1315
} as const;
1416
};

packages/react-email/src/utils/preview/start-dev-server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { createJiti } from 'jiti';
55
import logSymbols from 'log-symbols';
66
import ora from 'ora';
77
import { registerSpinnerAutostopping } from '../../utils/register-spinner-autostopping.js';
8+
import { conf } from '../conf.js';
89
import { getPreviewServerLocation } from '../get-preview-server-location.js';
910
import { packageJson } from '../packageJson.js';
1011
import { styleText } from '../style-text.js';
@@ -131,6 +132,7 @@ export const startDevServer = async (
131132
path.normalize(emailsDirRelativePath),
132133
previewServerLocation,
133134
process.cwd(),
135+
conf.get('resendApiKey'),
134136
),
135137
};
136138

0 commit comments

Comments
 (0)