-
Notifications
You must be signed in to change notification settings - Fork 1
#43 - Create endpoint for sending emails #54
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
base: main
Are you sure you want to change the base?
Conversation
| import { SES as AmazonSESClient } from '@aws-sdk/client-ses'; | ||
| import { strict as assert } from 'node:assert'; | ||
| import * as dotenv from 'dotenv'; | ||
| import path from 'node:path'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I struggled getting the docker to recognize the env variables, might not be necessary once we move to secrets manager?
| import path from 'node:path'; | ||
| dotenv.config({ path: path.resolve(__dirname, '.env') }); | ||
|
|
||
| export const AMAZON_SES_CLIENT = 'AMAZON_SES_CLIENT'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to hardcode this so that nestJS would recognize it, otherwise I got the error that ERROR [ExceptionHandler] Nest can't resolve dependencies of the EmailsService (?).
| constructor(private readonly emailService: EmailsService) {} | ||
|
|
||
| @Post('send-email') | ||
| // @UseGuards(JwtAuthGuard) (should use auth, not implemented rn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented out for now, should be uncommented once auth is added to the project for security
| @@ -0,0 +1,116 @@ | |||
| import { Test, TestingModule } from '@nestjs/testing'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this sufficient testing? I am still new to backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok for now!
| useFactory: (configService: ConfigService) => { | ||
| return new Stripe(configService.get<string>('STRIPE_SECRET_KEY'), { | ||
| apiVersion: '2025-09-30.clover', | ||
| apiVersion: '2025-12-15.clover', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep having an issue with this file reverting / changing versions when I load my docker containers. I am not sure why this is happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into this.
| @@ -50,7 +50,6 @@ function Button({ | |||
| }) { | |||
| const Comp = asChild ? Slot : 'button'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not modify, this is from merging my PR with main to avoid merge conflicts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can leave that there actuallyy
docker-compose.dev.yml
Outdated
| JWT_SECRET: dev-secret-change-in-prod | ||
|
|
||
| AWS_SES_REGION: us-east-2 | ||
| AWS_SES_ACCESS_KEY_ID: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker compose must be modified for the code to compile, AWS key + AWS sender email is necessary.
| "private": true, | ||
| "dependencies": { | ||
| "@aws-sdk/client-cognito-identity-provider": "^3.410.0", | ||
| "@aws-sdk/client-ses": "^3.975.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had to add ses to the project
| @@ -2,1328 +2,1346 @@ | |||
| # yarn lockfile v1 | |||
|
|
|||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added ses to the proejct
| @@ -50,7 +50,6 @@ function Button({ | |||
| }) { | |||
| const Comp = asChild ? Slot : 'button'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can leave that there actuallyy
| @@ -0,0 +1,116 @@ | |||
| import { Test, TestingModule } from '@nestjs/testing'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok for now!
Description
Briefly describe the changes and why they are needed.
Changes Made
Testing & Verification
IMPORTANT!!!
docker-compose.dev.yml🚨Verification Steps:
Screenshots (if relevant)
Future Improvements/Notes
Related Issues
Closes #43