-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore : added otp mail functionality and files renamed
- Loading branch information
1 parent
3cff959
commit 4284ed3
Showing
12 changed files
with
115 additions
and
36 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
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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import { Controller, Post } from '@nestjs/common'; | ||
import { MailerService } from './mailer.service'; | ||
// import { Controller, Post } from '@nestjs/common'; | ||
// import { MailerService } from './mailer.service'; | ||
|
||
@Controller('mail') | ||
export class MailerController { | ||
constructor(private mailerService: MailerService) {} | ||
// @Controller('mail') | ||
// export class MailerController { | ||
// constructor(private mailerService: MailerService) {} | ||
|
||
// @Public() | ||
// @Post() | ||
// async sendMail() { | ||
// await this.mailerService.sendMPassGenerationEmail( | ||
// '[email protected]', | ||
// 'Saswat', | ||
// 'XYZ' | ||
// ) | ||
// await this.mailerService.sendSupportTicketResolvedEmail( | ||
// '[email protected]', | ||
// 'Saswat', | ||
// '123456' | ||
// ) | ||
// } | ||
} | ||
// // @Public() | ||
// // @Post() | ||
// // async sendMail() { | ||
// // await this.mailerService.sendMPassGenerationEmail( | ||
// // '[email protected]', | ||
// // 'Saswat', | ||
// // 'XYZ' | ||
// // ) | ||
// // await this.mailerService.sendSupportTicketResolvedEmail( | ||
// // '[email protected]', | ||
// // 'Saswat', | ||
// // '123456' | ||
// // ) | ||
// // } | ||
// } |
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 |
---|---|---|
|
@@ -9,17 +9,20 @@ export class MailerService { | |
|
||
async sendMail( | ||
to: string, | ||
subject: string, | ||
content: string, | ||
// subject: string, | ||
// content: string, | ||
otp: string, | ||
template?: string, | ||
context?: Record<string, any>, | ||
//context?: Record<string, any>, | ||
) { | ||
await this.mailerService.sendMail({ | ||
to, | ||
subject, | ||
text: content, | ||
subject: 'OTP for your account', | ||
template: template ? `./${template}` : undefined, | ||
context: context || {}, | ||
context: { | ||
otp, | ||
supportEmail: '[email protected]', | ||
}, | ||
}); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,68 @@ | ||
<p> Use | ||
the OTP below to complete the process:</p> | ||
<div class='otp'> {{otp}} </div> | ||
<p>This OTP is valid for 15 minutes. If you didn’t request this, please ignore | ||
this email or contact support at | ||
{{supportEmail}}</p> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f4f4f4; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
.container { | ||
max-width: 600px; | ||
margin: 20px auto; | ||
background-color: #ffffff; | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
} | ||
.header { | ||
text-align: center; | ||
padding-bottom: 20px; | ||
border-bottom: 1px solid #dddddd; | ||
} | ||
.header h1 { | ||
margin: 0; | ||
color: #333333; | ||
} | ||
.content { | ||
padding: 20px 0; | ||
} | ||
.otp { | ||
font-size: 24px; | ||
font-weight: bold; | ||
color: #333333; | ||
text-align: center; | ||
margin: 20px 0; | ||
} | ||
.footer { | ||
text-align: center; | ||
padding-top: 20px; | ||
border-top: 1px solid #dddddd; | ||
color: #777777; | ||
} | ||
.footer a { | ||
color: #007BFF; | ||
text-decoration: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="header"> | ||
<h1>Programming Society</h1> | ||
</div> | ||
<div class="content"> | ||
<p>Dear Member,</p> | ||
<p>Use the OTP below to complete the process:</p> | ||
<div class="otp">{{otp}}</div> | ||
<p>This OTP is valid for 10 minutes. If you didn’t request this, please ignore this email or contact support at <a href="mailto:{{supportEmail}}">{{supportEmail}}</a>.</p> | ||
</div> | ||
<div class="footer"> | ||
<p>Thank you,<br>Programming Society Team</p> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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