Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api): Get feedback forward email from process.env #236

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = '[email protected]'
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
Loading