Skip to content

Commit

Permalink
feat: Remove extra env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorocha committed Jun 4, 2023
1 parent d545599 commit 9efbbf3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
RESEND_API_KEY=""
EMAIL_FROM=""
EMAIL_TO=""
RESEND_API_KEY=""
6 changes: 3 additions & 3 deletions app/api/send/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const resend = new Resend(process.env.RESEND_API_KEY);
export async function GET() {
try {
const data = await resend.sendEmail({
from: process.env.EMAIL_FROM || '',
to: process.env.EMAIL_TO || '',
subject: "hello world",
from: '[email protected]',
to: '[email protected]',
subject: "Hello world",
react: EmailTemplate({ firstName: "John", product: "Resend" }),
});

Expand Down
4 changes: 1 addition & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ function throwError(envVar) {
throw `Abort: You need to define ${envVar} in the .env file.`
}

if (!process.env.RESEND_API_KEY) return throwError('RESEND_API_KEY');
if (!process.env.EMAIL_FROM) return throwError('EMAIL_FROM');
if (!process.env.EMAIL_TO) return throwError('EMAIL_TO');
if (!process.env.RESEND_API_KEY) return throwError('RESEND_API_KEY');

0 comments on commit 9efbbf3

Please sign in to comment.