Order api: create order schema
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user