From c81da5206548216d8d2036b725650cf6e8d02647 Mon Sep 17 00:00:00 2001 From: Joywin Bennis <107112207+joywin2003@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:18:07 +0530 Subject: [PATCH] Refactor: Added the resend api key in actions --- .github/workflows/test.yml | 3 +++ src/lib/resend-mailer.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c54f3cf..f81a96b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,6 +36,7 @@ jobs: echo "GOOGLE_SECRET is set: ${{ env.GOOGLE_SECRET != '' }}" echo "TURSO_AUTH_TOKEN is set: ${{ env.TURSO_AUTH_TOKEN != '' }}" echo "TURSO_DATABASE_URL is set: ${{ env.TURSO_DATABASE_URL != '' }}" + echo "RESEND_API_KEY" is set ${{ env.RESEND_API_KEY != '' }} env: NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }} NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} @@ -43,6 +44,7 @@ jobs: GOOGLE_SECRET: ${{ secrets.GOOGLE_SECRET }} TURSO_AUTH_TOKEN: ${{ secrets.TURSO_AUTH_TOKEN }} TURSO_DATABASE_URL: ${{ secrets.TURSO_DATABASE_URL }} + RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} - name: Build project run: npm run build @@ -53,6 +55,7 @@ jobs: NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }} TURSO_AUTH_TOKEN: ${{ secrets.TURSO_AUTH_TOKEN }} TURSO_DATABASE_URL: ${{ secrets.TURSO_DATABASE_URL }} + RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} - name: Upload build artifacts (optional) if: always() diff --git a/src/lib/resend-mailer.ts b/src/lib/resend-mailer.ts index 3ad280b..fb65c8c 100644 --- a/src/lib/resend-mailer.ts +++ b/src/lib/resend-mailer.ts @@ -5,9 +5,10 @@ import { Resend } from "resend"; const resend = new Resend(process.env.RESEND_API_KEY); export async function MailUsingResend({ email, name, OTP }: SendEmailType) { + console.log(process.env.RESEND_API_KEY); try { const mailOptions: ResendEmailOptions = { - from: "Tedx SJEC ", + from: "Tedx SJEC ", to: email, subject: "Tedx SJEC - Your OTP for Email Verification", react: EmailTemplate({