Skip to content

Commit

Permalink
chore(api): Get feedback forward email from process.env (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
Princeyadav05 authored May 23, 2024
1 parent 5ea9a10 commit 204c9d1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
DOMAIN=localhost

FEEDBACK_FORWARD_EMAIL=
4 changes: 3 additions & 1 deletion apps/api/src/common/env/env.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof generalSchema>
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/feedback/service/feedback.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
1 change: 1 addition & 0 deletions docs/contributing-to-keyshade/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 204c9d1

Please sign in to comment.