Order api: create order schema

This commit is contained in:
Md Sharafat Hassain
2026-04-12 22:47:56 +06:00
parent 308445f346
commit ee5eb0f0f5
20 changed files with 443 additions and 33 deletions
+21 -21
View File
@@ -1,31 +1,31 @@
import nodemailer from 'nodemailer';
import { configs } from '../configs';
import { configs } from '../errors/configs';
type TMailContent = {
to: string,
subject: string,
textBody: string,
htmlBody: string,
name?: string
to: string,
subject: string,
textBody: string,
htmlBody: string,
name?: string
}
const transporter = nodemailer.createTransport({
host: "smtp.gmail.com",
port: 465,
secure: true, // true for 465, false for other ports
auth: {
user: configs.email.app_email!,
pass: configs.email.app_password!,
},
host: "smtp.gmail.com",
port: 465,
secure: true, // true for 465, false for other ports
auth: {
user: configs.email.app_email!,
pass: configs.email.app_password!,
},
});
// ✅ Email Sender Function
const sendMail = async (payload: TMailContent) => {
const info = await transporter.sendMail({
from: 'info@digitalcreditai.com',
to: payload.to,
subject: payload.subject,
text: payload.textBody,
html: `
const info = await transporter.sendMail({
from: 'info@digitalcreditai.com',
to: payload.to,
subject: payload.subject,
text: payload.textBody,
html: `
<!doctype html>
<html lang="en">
<head>
@@ -116,8 +116,8 @@ const sendMail = async (payload: TMailContent) => {
`,
});
return info
});
return info
};
export default sendMail;