-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch: replace resend with nodemailer
- Loading branch information
Showing
19 changed files
with
1,547 additions
and
1,134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,13 @@ DATABASE_URL=postgresql://postgres:<your-project-password>@db.<your-project-name | |
SUPABASE_API_URL=https://<your-project-name>.supabase.co | ||
SUPABASE_ANON_KEY= | ||
|
||
RESEND_API_KEY=re_ | ||
SMTP_HOST= | ||
SMTP_PORT= | ||
SMTP_EMAIL_ADDRESS= | ||
SMTP_PASSWORD= | ||
FROM_EMAIL="your-name <[email protected]>" | ||
|
||
JWT_SECRET=secret | ||
|
||
FROM_EMAIL="your-name <[email protected]>" | ||
WEB_FRONTEND_URL=https://keyshade.xyz | ||
WORKSPACE_FRONTEND_URL=https://app.keyshade.xyz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Global, Module } from '@nestjs/common' | ||
import { MailService } from './services/mail.service' | ||
import { MAIL_SERVICE } from './services/interface.service' | ||
|
||
@Global() | ||
@Module({ | ||
providers: [ | ||
{ | ||
provide: MAIL_SERVICE, | ||
useClass: MailService | ||
} | ||
], | ||
exports: [ | ||
{ | ||
provide: MAIL_SERVICE, | ||
useClass: MailService | ||
} | ||
] | ||
}) | ||
export class MailModule {} |
4 changes: 2 additions & 2 deletions
4
...send/services/resend.service.interface.ts → ...pi/src/mail/services/interface.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { Logger } from '@nestjs/common' | ||
import { IMailService } from './interface.service' | ||
import { ProjectRole } from '@prisma/client' | ||
|
||
export class MockMailService implements IMailService { | ||
private readonly log = new Logger(MockMailService.name) | ||
|
||
async projectInvitationMailForRegisteredUser( | ||
email: string, | ||
project: string, | ||
actionUrl: string, | ||
invitee: string, | ||
role: ProjectRole | ||
): Promise<void> { | ||
this.log.log( | ||
`Project Invitation Mail for Registered User: ${email}, ${project}, ${actionUrl}, ${invitee}, ${role}` | ||
) | ||
} | ||
|
||
async projectInvitationMailForNonRegisteredUser( | ||
email: string, | ||
project: string, | ||
actionUrl: string, | ||
invitee: string, | ||
role: ProjectRole | ||
): Promise<void> { | ||
this.log.log( | ||
`Project Invitation Mail for Non Registered User: ${email}, ${project}, ${actionUrl}, ${invitee}, ${role}` | ||
) | ||
} | ||
|
||
async sendOtp(email: string, otp: string): Promise<void> { | ||
this.log.log(`OTP for ${email} is ${otp}`) | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
...rc/resend/services/resend.service.spec.ts → .../src/mail/services/resend.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.