File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 "@types/jsonwebtoken" : " ^9.0.10" ,
2626 "@types/multer" : " ^1.4.13" ,
2727 "@types/node" : " ^24.0.3" ,
28- "@types/nodemailer" : " ^7.0.9" ,
2928 "@types/uuid4" : " ^2.0.3" ,
3029 "concurrently" : " ^9.1.2" ,
3130 "dotenv-cli" : " ^8.0.0" ,
3938 "typescript-eslint" : " ^8.34.0"
4039 },
4140 "dependencies" : {
41+ "@sendgrid/mail" : " ^8.1.6" ,
4242 "@supabase/supabase-js" : " ^2.50.0" ,
4343 "bcrypt" : " ^6.0.0" ,
4444 "cookie-parser" : " ^1.4.7" ,
5050 "jsonwebtoken" : " ^9.0.2" ,
5151 "mongoose" : " ^8.16.0" ,
5252 "multer" : " ^2.0.1" ,
53- "nodemailer" : " ^8.0.0" ,
5453 "uuid4" : " ^2.0.3" ,
5554 "ws" : " ^8.18.2"
5655 }
Original file line number Diff line number Diff line change 11import Redis from "ioredis" ;
2- import nodemailer from "nodemailer " ;
2+ import sgMail from "@sendgrid/mail " ;
33import dotenv from "dotenv"
44dotenv . config ( ) ;
55
6- const transporter = nodemailer . createTransport ( {
7- host : "smtp.gmail.com" ,
8- port : 465 ,
9- secure : true ,
10- auth : {
11- user : process . env . EMAIL_USER ,
12- pass : process . env . EMAIL_PASS ,
13- } ,
14- } ) ;
6+ sgMail . setApiKey ( process . env . SENDGRID_API_KEY ! ) ;
157const redis = new Redis ( process . env . REDIS_URL || '' ) ;
168
179async function sendEmail ( to : string ) {
18- await transporter . sendMail ( {
19- from : process . env . EMAIL_USER ,
10+ await sgMail . send ( {
2011 to,
12+ from : process . env . EMAIL_USER ! ,
2113 subject : "Welcome back" ,
2214 text : "Hello Aryan 👋" ,
2315 } ) ;
You can’t perform that action at this time.
0 commit comments