Skip to content

Commit

Permalink
index
Browse files Browse the repository at this point in the history
  • Loading branch information
zobkazi committed Apr 28, 2024
1 parent b71b2b3 commit 8afdf3d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/services/email/src/controllers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { amqp } from 'amqplib';
const amqpConnection = amqp.connect('amqp://localhost');
18 changes: 17 additions & 1 deletion packages/services/email/src/controllers/sendEmail.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
import { Request, Response, NextFunction } from 'express';
import prisma from '@/utils/prisma';
import { EmailCreateSchema } from '@/utils/schemas';
import { defaultSender, transporter } from '@/config';
import { defaultSender, transporter } from '@/config';




const sendEmail = async (req: Request, res: Response, next: NextFunction) => {
try {
// validate input the req body
const parsedBody = EmailCreateSchema.safeParse(req.body)

if (!parsedBody.success) {
return res.status(400).json(parsedBody.error.errors)
}
} catch (error) {
next(error)
}
}

0 comments on commit 8afdf3d

Please sign in to comment.