From 5da3729f99406c885016999989e2920f70aa27f8 Mon Sep 17 00:00:00 2001 From: FleetAdmiralJakob Date: Mon, 15 Jan 2024 19:36:36 +0100 Subject: [PATCH] feat: Changed the subject if the form was created via a test --- .github/workflows/playwright.yml | 1 + packages/api/src/routers/email.ts | 4 +++- turbo.json | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 0bf8cd2d..cc46cf4c 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -39,6 +39,7 @@ jobs: RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} QWEATHER_API_KEY: ${{ secrets.QWEATHER_API_KEY }} API_NINJA_API_KEY: ${{ secrets.API_NINJA_API_KEY }} + TEST_MODE: true - uses: actions/upload-artifact@v4 if: always() with: diff --git a/packages/api/src/routers/email.ts b/packages/api/src/routers/email.ts index 66ac46c0..4b9d5b5f 100644 --- a/packages/api/src/routers/email.ts +++ b/packages/api/src/routers/email.ts @@ -29,7 +29,9 @@ export const emailRouter = createTRPCRouter({ return await resend.emails.send({ from: "onbording@resend.dev", to: "jakob.roessner@outlook.de", - subject: "Form Email from Weather.io", + subject: !process.env.TEST_MODE + ? "Form Email from Weather.io" + : "TEST: Form Email from Weather.io", react: FormEmail({ firstName: input.firstName, lastName: input.lastName, diff --git a/turbo.json b/turbo.json index 42716c98..ba0c7f23 100644 --- a/turbo.json +++ b/turbo.json @@ -55,6 +55,7 @@ "UPSTASH_RATELIMITER_TIME_INTERVAL", "RESEND_API_KEY", "QWEATHER_API_KEY", - "API_NINJA_API_KEY" + "API_NINJA_API_KEY", + "TEST_MODE" ] }