diff --git a/.env.example b/.env.example index becff0d3..56ccdb4c 100644 --- a/.env.example +++ b/.env.example @@ -38,4 +38,6 @@ PLATFORM_FRONTEND_URL=http://localhost:3100 PLATFORM_OAUTH_SUCCESS_REDIRECT_PATH=/oauth/signin PLATFORM_OAUTH_FAILURE_REDIRECT_PATH=/oauth/failure -DOMAIN=localhost \ No newline at end of file +DOMAIN=localhost + +FEEDBACK_FORWARD_EMAIL= \ No newline at end of file diff --git a/apps/api/src/common/env/env.schema.ts b/apps/api/src/common/env/env.schema.ts index 856b326d..a63f5173 100644 --- a/apps/api/src/common/env/env.schema.ts +++ b/apps/api/src/common/env/env.schema.ts @@ -66,7 +66,9 @@ const generalSchema = z.object({ WEB_FRONTEND_URL: z.string().url(), PLATFORM_FRONTEND_URL: z.string().url(), PLATFORM_OAUTH_SUCCESS_REDIRECT_PATH: z.string(), - PLATFORM_OAUTH_FAILURE_REDIRECT_PATH: z.string() + PLATFORM_OAUTH_FAILURE_REDIRECT_PATH: z.string(), + + FEEDBACK_FORWARD_EMAIL: z.string() }) export type EnvSchemaType = z.infer diff --git a/apps/api/src/feedback/service/feedback.service.ts b/apps/api/src/feedback/service/feedback.service.ts index d8ccae5d..9b589db1 100644 --- a/apps/api/src/feedback/service/feedback.service.ts +++ b/apps/api/src/feedback/service/feedback.service.ts @@ -14,7 +14,7 @@ export class FeedbackService { if (!feedback || feedback.trim().length === 0) { throw new BadRequestException('Feedback cannot be null or empty') } - const adminEmail = 'admin@keyshade.xyz' + const adminEmail = process.env.FEEDBACK_FORWARD_EMAIL; await this.mailService.feedbackEmail(adminEmail, feedback.trim()) } diff --git a/docs/contributing-to-keyshade/environment-variables.md b/docs/contributing-to-keyshade/environment-variables.md index e3067e60..1afcafe4 100644 --- a/docs/contributing-to-keyshade/environment-variables.md +++ b/docs/contributing-to-keyshade/environment-variables.md @@ -26,3 +26,4 @@ Here's the description of the environment variables used in the project. You can - **JWT_SECRET**: The secret used to sign the JWT tokens. It is insignificant in the development environment. - **WEB_FRONTEND_URL, WORKSPACE_FRONTEND_URL**: The URLs of the web and workspace frontend respectively. These are used in the emails sometimes and in other spaces of the application too. - **API_PORT**: The environmental variable that specifies the port number on which the API server should listen for incoming connections. If not explicitly set, it defaults to port 4200. +- **FEEDBACK_FORWARD_EMAIL**: Feedbacks submitted by the user would be sent to this email address for the concerned authorities to view it. Ideally, in development environment, this would be your personal email address