Skip to content

Commit c140f37

Browse files
committed
add email resend reset command
1 parent f93a231 commit c140f37

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import logSymbols from 'log-symbols';
2+
import { conf } from '../../utils/conf.js';
3+
4+
export async function resendReset() {
5+
conf.delete('resendApiKey');
6+
7+
console.info(`${logSymbols.success} Resend API Key successfully deleted`);
8+
}

packages/react-email/src/commands/resend-setup.ts renamed to packages/react-email/src/commands/resend/setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logSymbols from 'log-symbols';
22
import prompts from 'prompts';
3-
import { conf } from '../utils/conf.js';
4-
import { styleText } from '../utils/style-text.js';
3+
import { conf } from '../../utils/conf.js';
4+
import { styleText } from '../../utils/style-text.js';
55

66
export async function resendSetup() {
77
const previousValue = conf.get('resendApiKey');

packages/react-email/src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { program } from 'commander';
33
import { build } from './commands/build.js';
44
import { dev } from './commands/dev.js';
55
import { exportTemplates } from './commands/export.js';
6-
import { resendSetup } from './commands/resend-setup.js';
6+
import { resendReset } from './commands/resend/reset.js';
7+
import { resendSetup } from './commands/resend/setup.js';
78
import { start } from './commands/start.js';
89
import { packageJson } from './utils/packageJson.js';
910

@@ -61,4 +62,12 @@ program
6162
)
6263
.action(resendSetup);
6364

65+
program
66+
.command('resend')
67+
.command('reset')
68+
.description(
69+
'Deletes your API Key from the React Email configuration',
70+
)
71+
.action(resendReset);
72+
6473
program.parse();

0 commit comments

Comments
 (0)