shippin address
This commit is contained in:
parent
ef3ddc6669
commit
b560d3a324
@ -384,34 +384,25 @@ export const paymentVerification = async (req, res) => {
|
||||
from: `${process.env.SEND_EMAIL_FROM}`, // Change to your verified sender
|
||||
|
||||
subject: `Your Order #${findSameOrder?.orderID} Confirmation`,
|
||||
html: ` <h1 style="color: #333; text-align: center; font-family: Arial, sans-serif;">Welcome to Smellika - Let the Shopping Begin!</h1>
|
||||
<strong style="color: #1b03a3; font-size: 16px"> Hi ${
|
||||
findSameOrder?.shippingInfo?.first_Name
|
||||
html: ` <h1 style="color: #333; text-align: center; font-family: Arial, sans-serif;">Welcome to Tavisa - Let the Shopping Begin!</h1>
|
||||
<strong style="color: #1b03a3; font-size: 16px"> Hi ${findSameOrder?.shippingInfo?.first_Name
|
||||
},</strong>
|
||||
|
||||
<p style="color: #555; font-size: 15px;">Great news! Your order #${
|
||||
findSameOrder?.orderID
|
||||
<p style="color: #555; font-size: 15px;">Great news! Your order #${findSameOrder?.orderID
|
||||
} has been confirmed. Here are the details</p>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Shipping Address : ${
|
||||
findSameOrder?.shippingInfo?.first_Name
|
||||
} ${findSameOrder?.shippingInfo?.last_Name} , ${
|
||||
findSameOrder?.shippingInfo?.street
|
||||
} ${findSameOrder?.shippingInfo?.city} ${
|
||||
findSameOrder?.shippingInfo?.state
|
||||
} ${findSameOrder?.shippingInfo?.country}, PIN-${
|
||||
findSameOrder?.shippingInfo?.postalCode
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Shipping Address : ${findSameOrder?.shippingInfo?.first_Name
|
||||
} ${findSameOrder?.shippingInfo?.last_Name} , ${findSameOrder?.shippingInfo?.street
|
||||
} ${findSameOrder?.shippingInfo?.city} ${findSameOrder?.shippingInfo?.state
|
||||
} ${findSameOrder?.shippingInfo?.country}, PIN-${findSameOrder?.shippingInfo?.postalCode
|
||||
}, Phone Number: ${findSameOrder?.shippingInfo?.phone_Number}
|
||||
${
|
||||
findSameOrder?.shippingInfo?.company_name
|
||||
${findSameOrder?.shippingInfo?.company_name
|
||||
? ",Company Name :" + findSameOrder?.shippingInfo?.company_name + ""
|
||||
: ""
|
||||
} ${
|
||||
findSameOrder?.shippingInfo?.gst_number
|
||||
} ${findSameOrder?.shippingInfo?.gst_number
|
||||
? ", GST_NO:" + findSameOrder?.shippingInfo?.gst_number
|
||||
: ""
|
||||
}</h4>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;"> Any Discount : ${
|
||||
findSameOrder?.isCouponUsed
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;"> Any Discount : ${findSameOrder?.isCouponUsed
|
||||
? "Yes ,₹" +
|
||||
Number(findSameOrder?.couponUsed?.discount_amount) +
|
||||
" , COUPON_CODE:" +
|
||||
@ -442,33 +433,24 @@ export const paymentVerification = async (req, res) => {
|
||||
?.map(
|
||||
(product, index) => `
|
||||
<tr>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
index + 1
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${index + 1
|
||||
}</td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product?.variant_Name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product?.variant_Name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${
|
||||
product?.image[0]?.url
|
||||
}" alt="${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${product?.image[0]?.url
|
||||
}" alt="${product.name
|
||||
}" style="max-width: 40px; height: auto;"></td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.quantity
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.quantity
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.price
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.price
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product?.gst_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product?.gst_amount
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product?.product_Subtotal
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product?.product_Subtotal
|
||||
}</td>
|
||||
|
||||
</tr>
|
||||
@ -477,8 +459,7 @@ export const paymentVerification = async (req, res) => {
|
||||
.join("")}
|
||||
<tr>
|
||||
<th colspan="7" style="border: 1px solid #555; padding: 2px; text-align: right;">Total Amount :</th>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
findSameOrder?.total_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${findSameOrder?.total_amount
|
||||
}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -487,7 +468,7 @@ export const paymentVerification = async (req, res) => {
|
||||
<br/>
|
||||
<span style="color: #555; font-size: 13px;">Best regards,</span><br/>
|
||||
|
||||
<span style="color: #555; font-size: 13px;">Team Smellika</span>`,
|
||||
<span style="color: #555; font-size: 13px;">Team Tavisa</span>`,
|
||||
});
|
||||
// console.log("findSameOrder", findSameOrder);
|
||||
|
||||
@ -501,7 +482,7 @@ export const paymentVerification = async (req, res) => {
|
||||
// razorpay_signature,
|
||||
// });
|
||||
|
||||
res.redirect(`https://smellika.com/shop`);
|
||||
res.redirect(`https://ayurpulse-website.netlify.app/shop`);
|
||||
// res.redirect(
|
||||
// `http://localhost:5173/cart/paymentsuccess?reference=${razorpay_payment_id}`
|
||||
// );
|
||||
@ -554,34 +535,25 @@ export const pospaymentVerification = async (req, res) => {
|
||||
from: `${process.env.SEND_EMAIL_FROM}`, // Change to your verified sender
|
||||
|
||||
subject: `Your Order #${findSameOrder?.orderID} Confirmation`,
|
||||
html: ` <h1 style="color: #333; text-align: center; font-family: Arial, sans-serif;">Welcome to Smellika - Let the Shopping Begin!</h1>
|
||||
<strong style="color: #1b03a3; font-size: 16px"> Hi ${
|
||||
findSameOrder?.shippingInfo?.first_Name
|
||||
html: ` <h1 style="color: #333; text-align: center; font-family: Arial, sans-serif;">Welcome to Tavisa - Let the Shopping Begin!</h1>
|
||||
<strong style="color: #1b03a3; font-size: 16px"> Hi ${findSameOrder?.shippingInfo?.first_Name
|
||||
},</strong>
|
||||
|
||||
<p style="color: #555; font-size: 15px;">Great news! Your order #${
|
||||
findSameOrder?.orderID
|
||||
<p style="color: #555; font-size: 15px;">Great news! Your order #${findSameOrder?.orderID
|
||||
} has been confirmed. Here are the details</p>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Shipping Address : ${
|
||||
findSameOrder?.shippingInfo?.first_Name
|
||||
} ${findSameOrder?.shippingInfo?.last_Name} , ${
|
||||
findSameOrder?.shippingInfo?.street
|
||||
} ${findSameOrder?.shippingInfo?.city} ${
|
||||
findSameOrder?.shippingInfo?.state
|
||||
} ${findSameOrder?.shippingInfo?.country}, PIN-${
|
||||
findSameOrder?.shippingInfo?.postalCode
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Shipping Address : ${findSameOrder?.shippingInfo?.first_Name
|
||||
} ${findSameOrder?.shippingInfo?.last_Name} , ${findSameOrder?.shippingInfo?.street
|
||||
} ${findSameOrder?.shippingInfo?.city} ${findSameOrder?.shippingInfo?.state
|
||||
} ${findSameOrder?.shippingInfo?.country}, PIN-${findSameOrder?.shippingInfo?.postalCode
|
||||
}, Phone Number: ${findSameOrder?.shippingInfo?.phone_Number}
|
||||
${
|
||||
findSameOrder?.shippingInfo?.company_name
|
||||
${findSameOrder?.shippingInfo?.company_name
|
||||
? ",Company Name :" + findSameOrder?.shippingInfo?.company_name + ""
|
||||
: ""
|
||||
} ${
|
||||
findSameOrder?.shippingInfo?.gst_number
|
||||
} ${findSameOrder?.shippingInfo?.gst_number
|
||||
? ", GST_NO:" + findSameOrder?.shippingInfo?.gst_number
|
||||
: ""
|
||||
}</h4>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;"> Any Discount: ${
|
||||
findSameOrder?.isCouponUsed
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;"> Any Discount: ${findSameOrder?.isCouponUsed
|
||||
? "Yes ,₹" +
|
||||
Number(findSameOrder?.couponUsed?.discount_amount) +
|
||||
" , COUPON_CODE:" +
|
||||
@ -612,33 +584,24 @@ export const pospaymentVerification = async (req, res) => {
|
||||
?.map(
|
||||
(product, index) => `
|
||||
<tr>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
index + 1
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${index + 1
|
||||
}</td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product?.variant_Name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product?.variant_Name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${
|
||||
product?.image[0]?.url
|
||||
}" alt="${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${product?.image[0]?.url
|
||||
}" alt="${product.name
|
||||
}" style="max-width: 40px; height: auto;"></td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.quantity
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.quantity
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.price
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.price
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product?.gst_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product?.gst_amount
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product?.product_Subtotal
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product?.product_Subtotal
|
||||
}</td>
|
||||
|
||||
</tr>
|
||||
@ -647,8 +610,7 @@ export const pospaymentVerification = async (req, res) => {
|
||||
.join("")}
|
||||
<tr>
|
||||
<th colspan="7" style="border: 1px solid #555; padding: 2px; text-align: right;">Total Amount :</th>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
findSameOrder?.total_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${findSameOrder?.total_amount
|
||||
}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -657,7 +619,7 @@ export const pospaymentVerification = async (req, res) => {
|
||||
<br/>
|
||||
<span style="color: #555; font-size: 13px;">Best regards,</span><br/>
|
||||
|
||||
<span style="color: #555; font-size: 13px;">Team Smellika</span>`,
|
||||
<span style="color: #555; font-size: 13px;">Team Tavisa</span>`,
|
||||
});
|
||||
// console.log("findSameOrder", findSameOrder);
|
||||
|
||||
@ -801,24 +763,24 @@ export const webhook = async (req, res) => {
|
||||
from: `${process.env.SEND_EMAIL_FROM}`, // Change to your verified sender
|
||||
|
||||
subject: `Your Order #${findOrder?.orderID} Confirmation`,
|
||||
html: ` <h1 style="color: #333; text-align: center; font-family: Arial, sans-serif;">Welcome to Smellika - Let the Shopping Begin!</h1>
|
||||
html: ` <h1 style="color: #333; text-align: center; font-family: Arial, sans-serif;">Welcome to Tavisa - Let the Shopping Begin!</h1>
|
||||
<strong style="color: #1b03a3; font-size: 16px"> Hi ${findOrder?.shippingInfo?.first_Name},</strong>
|
||||
|
||||
<p style="color: #555; font-size: 15px;">Great news! Your order #${findOrder?.orderID} has been confirmed. Here are the details</p>
|
||||
<br/>
|
||||
<span style="color: #555; font-size: 13px;">Best regards,</span><br/>
|
||||
|
||||
<span style="color: #555; font-size: 13px;">Team Smellika</span>`,
|
||||
<span style="color: #555; font-size: 13px;">Team Tavisa</span>`,
|
||||
});
|
||||
|
||||
// Items: [List of Purchased Items]
|
||||
// Total Amount: [Total Amount]
|
||||
// Shipping Address: [Shipping Address]
|
||||
|
||||
// We'll keep you updated on the shipping progress. Thanks for choosing Smellika!
|
||||
// We'll keep you updated on the shipping progress. Thanks for choosing Tavisa!
|
||||
|
||||
// Best regards
|
||||
// Team Smellika
|
||||
// Team Tavisa
|
||||
console.log(
|
||||
"event.data.object",
|
||||
event.data.object,
|
||||
|
@ -173,15 +173,12 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
to: `${order?.user?.email}`, // Change to your recipient
|
||||
from: `${process.env.SEND_EMAIL_FROM}`, // Change to your verified sender
|
||||
subject: `Order #${order?.orderID} Update: Cancellation and Refund Process`,
|
||||
html: `<strong style="color: #1b03a3; font-size: 16px"> Hi ${
|
||||
order?.shippingInfo?.first_Name
|
||||
html: `<strong style="color: #1b03a3; font-size: 16px"> Hi ${order?.shippingInfo?.first_Name
|
||||
},</strong>
|
||||
<h3 style="color: #333; font-family: Arial, sans-serif;">We hope this message finds you well. We're writing to inform you that your order ${
|
||||
order?.orderID
|
||||
<h3 style="color: #333; font-family: Arial, sans-serif;">We hope this message finds you well. We're writing to inform you that your order ${order?.orderID
|
||||
} has been canceled. We understand that circumstances may change, and we're here to assist you throughout the process.</h3>
|
||||
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Any Discount : ${
|
||||
order?.isCouponUsed
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Any Discount : ${order?.isCouponUsed
|
||||
? "Yes ,₹" +
|
||||
Number(order?.couponUsed?.discount_amount) +
|
||||
" , COUPON_CODE:" +
|
||||
@ -208,33 +205,24 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
?.map(
|
||||
(product, index) => `
|
||||
<tr>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
index + 1
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${index + 1
|
||||
}</td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product?.variant_Name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product?.variant_Name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${
|
||||
product?.image[0]?.url
|
||||
}" alt="${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${product?.image[0]?.url
|
||||
}" alt="${product.name
|
||||
}" style="max-width: 40px; height: auto;"></td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.quantity
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.quantity
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.price
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.price
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product?.gst_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product?.gst_amount
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.product_Subtotal
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.product_Subtotal
|
||||
}</td>
|
||||
|
||||
</tr>
|
||||
@ -243,14 +231,12 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
.join("")}
|
||||
<tr>
|
||||
<th colspan="7" style="border: 1px solid #555; padding: 2px; text-align: right;">Total Amount :</th>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
order?.total_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${order?.total_amount
|
||||
}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Cancellation Reason : ${
|
||||
req.body?.ReasonforCancellation
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Cancellation Reason : ${req.body?.ReasonforCancellation
|
||||
}</h4>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Refund Information: The amount from your canceled order will be processed for a refund. Please allow up to 7 working days for the amount to be transferred back to your original payment method.</h4>
|
||||
|
||||
@ -259,7 +245,7 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
<br/>
|
||||
<span style="color: #555; font-size: 13px;">Best regards,</span><br/>
|
||||
|
||||
<span style="color: #555; font-size: 13px;">Team Smellika</span>`,
|
||||
<span style="color: #555; font-size: 13px;">Team Tavisa</span>`,
|
||||
});
|
||||
return res
|
||||
.status(200)
|
||||
@ -271,16 +257,13 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
to: `${order?.user?.email}`, // Change to your recipient
|
||||
from: `${process.env.SEND_EMAIL_FROM}`, // Change to your verified sender
|
||||
subject: `Your Order #${order?.orderID} is in Processing!`,
|
||||
html: ` <h3 style="color: #333; font-family: Arial, sans-serif;">Exciting news! Your order #${
|
||||
order?.orderID
|
||||
html: ` <h3 style="color: #333; font-family: Arial, sans-serif;">Exciting news! Your order #${order?.orderID
|
||||
} has entered the processing phase. Our team is diligently preparing your items for dispatch. Rest assured, we're working hard to ensure everything is perfect for you.</h3>
|
||||
<strong style="color: #1b03a3; font-size: 16px"> Hi ${
|
||||
order?.shippingInfo?.first_Name
|
||||
<strong style="color: #1b03a3; font-size: 16px"> Hi ${order?.shippingInfo?.first_Name
|
||||
},</strong>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Order Status : Processing</h4>
|
||||
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Any Discount : ${
|
||||
order?.isCouponUsed
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Any Discount : ${order?.isCouponUsed
|
||||
? "Yes ,₹" +
|
||||
Number(order?.couponUsed?.discount_amount) +
|
||||
" , COUPON_CODE:" +
|
||||
@ -311,33 +294,24 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
?.map(
|
||||
(product, index) => `
|
||||
<tr>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
index + 1
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${index + 1
|
||||
}</td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product?.variant_Name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product?.variant_Name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${
|
||||
product?.image[0]?.url
|
||||
}" alt="${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${product?.image[0]?.url
|
||||
}" alt="${product.name
|
||||
}" style="max-width: 40px; height: auto;"></td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.quantity
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.quantity
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.price
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.price
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product?.gst_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product?.gst_amount
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.product_Subtotal
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.product_Subtotal
|
||||
}</td>
|
||||
|
||||
</tr>
|
||||
@ -346,19 +320,18 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
.join("")}
|
||||
<tr>
|
||||
<th colspan="7" style="border: 1px solid #555; padding: 2px; text-align: right;">Total Amount :</th>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
order?.total_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${order?.total_amount
|
||||
}</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h5 style="color: #333; font-family: Arial, sans-serif;">We'll send you another email with the tracking details as soon as your order is dispatched. If you have any questions or need assistance, feel free to reply to this email.</h5>
|
||||
<h5 style="color: #333; font-family: Arial, sans-serif;">Thank you for choosing Smellika!</h5>
|
||||
<h5 style="color: #333; font-family: Arial, sans-serif;">Thank you for choosing Tavisa!</h5>
|
||||
<br/>
|
||||
<span style="color: #555; font-size: 13px;">Best regards,</span><br/>
|
||||
|
||||
<span style="color: #555; font-size: 13px;">Team Smellika</span>`,
|
||||
<span style="color: #555; font-size: 13px;">Team Tavisa</span>`,
|
||||
});
|
||||
return res
|
||||
.status(200)
|
||||
@ -394,22 +367,17 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
to: `${order?.user?.email}`, // Change to your recipient
|
||||
from: `${process.env.SEND_EMAIL_FROM}`, // Change to your verified sender
|
||||
subject: `Your Order #${order?.orderID} is On Its Way!`,
|
||||
html: `<strong style="color: #1b03a3; font-size: 16px"> Hi ${
|
||||
order?.shippingInfo?.first_Name
|
||||
html: `<strong style="color: #1b03a3; font-size: 16px"> Hi ${order?.shippingInfo?.first_Name
|
||||
},</strong>
|
||||
<h3 style="color: #333; font-family: Arial, sans-serif;">Exciting news! Your order #${
|
||||
order?.orderID
|
||||
<h3 style="color: #333; font-family: Arial, sans-serif;">Exciting news! Your order #${order?.orderID
|
||||
} has been dispatched and is en route to you. 🚚 Here are the details:</h3>
|
||||
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Courier Name : ${
|
||||
req.body.courierName
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Courier Name : ${req.body.courierName
|
||||
} </h4>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Courier Tracking ID : ${
|
||||
req.body.TrackingID
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Courier Tracking ID : ${req.body.TrackingID
|
||||
}</h4>
|
||||
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Any Discount : ${
|
||||
order?.isCouponUsed
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Any Discount : ${order?.isCouponUsed
|
||||
? "Yes ,₹" +
|
||||
Number(order?.couponUsed?.discount_amount) +
|
||||
" , COUPON_CODE:" +
|
||||
@ -439,33 +407,24 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
?.map(
|
||||
(product, index) => `
|
||||
<tr>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
index + 1
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${index + 1
|
||||
}</td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product?.variant_Name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product?.variant_Name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${
|
||||
product?.image[0]?.url
|
||||
}" alt="${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${product?.image[0]?.url
|
||||
}" alt="${product.name
|
||||
}" style="max-width: 40px; height: auto;"></td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.quantity
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.quantity
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.price
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.price
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product?.gst_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product?.gst_amount
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.product_Subtotal
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.product_Subtotal
|
||||
}</td>
|
||||
|
||||
</tr>
|
||||
@ -474,8 +433,7 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
.join("")}
|
||||
<tr>
|
||||
<th colspan="7" style="border: 1px solid #555; padding: 2px; text-align: right;">Total Amount :</th>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
order?.total_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${order?.total_amount
|
||||
}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -483,12 +441,12 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
<h3 style="color: #333; font-family: Arial, sans-serif;">Order Status : Dispatched</h3>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">If you have any questions or need assistance, feel free to reply to this email.
|
||||
</h4>
|
||||
<h5 style="color: #333; font-family: Arial, sans-serif;">Thanks for choosing Smellika! We hope you enjoy your purchase.
|
||||
<h5 style="color: #333; font-family: Arial, sans-serif;">Thanks for choosing Tavisa! We hope you enjoy your purchase.
|
||||
</h5>
|
||||
<br/>
|
||||
<span style="color: #555; font-size: 13px;">Best regards,</span><br/>
|
||||
|
||||
<span style="color: #555; font-size: 13px;">Team Smellika</span>`,
|
||||
<span style="color: #555; font-size: 13px;">Team Tavisa</span>`,
|
||||
});
|
||||
return res
|
||||
.status(200)
|
||||
@ -501,14 +459,11 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
to: `${order?.user?.email}`, // Change to your recipient
|
||||
from: `${process.env.SEND_EMAIL_FROM}`, // Change to your verified sender
|
||||
subject: `Your Order #${order?.orderID} Has Been Delivered!`,
|
||||
html: `<strong style="color: #1b03a3; font-size: 16px"> Hi ${
|
||||
order?.shippingInfo?.first_Name
|
||||
html: `<strong style="color: #1b03a3; font-size: 16px"> Hi ${order?.shippingInfo?.first_Name
|
||||
},</strong>
|
||||
<h3 style="color: #333; font-family: Arial, sans-serif;">Great news! Your order #${
|
||||
order?.orderID
|
||||
<h3 style="color: #333; font-family: Arial, sans-serif;">Great news! Your order #${order?.orderID
|
||||
} has been successfully delivered to your doorstep. We hope everything is just as you expected!</h3>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Any Discount : ${
|
||||
order?.isCouponUsed
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Any Discount : ${order?.isCouponUsed
|
||||
? "Yes ,₹" +
|
||||
Number(order?.couponUsed?.discount_amount) +
|
||||
" , COUPON_CODE:" +
|
||||
@ -537,33 +492,24 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
?.map(
|
||||
(product, index) => `
|
||||
<tr>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
index + 1
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${index + 1
|
||||
}</td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product?.variant_Name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product?.variant_Name
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${
|
||||
product?.image[0]?.url
|
||||
}" alt="${
|
||||
product.name
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;"><img src="${product?.image[0]?.url
|
||||
}" alt="${product.name
|
||||
}" style="max-width: 40px; height: auto;"></td>
|
||||
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${
|
||||
product.quantity
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">${product.quantity
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.price
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.price
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product?.gst_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product?.gst_amount
|
||||
}</td>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
product.product_Subtotal
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${product.product_Subtotal
|
||||
}</td>
|
||||
|
||||
</tr>
|
||||
@ -572,26 +518,24 @@ export const updateOrderStatusById = async (req, res) => {
|
||||
.join("")}
|
||||
<tr>
|
||||
<th colspan="7" style="border: 1px solid #555; padding: 2px; text-align: right;">Total Amount :</th>
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${
|
||||
order?.total_amount
|
||||
<td style="border: 1px solid #555; padding: 2px; text-align: center;">₹${order?.total_amount
|
||||
}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 style="color: #333; font-family: Arial, sans-serif;">Delivery Date: ${
|
||||
req.body.DDate
|
||||
<h3 style="color: #333; font-family: Arial, sans-serif;">Delivery Date: ${req.body.DDate
|
||||
}</h3>
|
||||
<h4 style="color: #333; font-family: Arial, sans-serif;">Your satisfaction is our priority, and we'd love to hear about your experience. Please take a moment to share your thoughts by leaving a review. Your feedback is invaluable to us!
|
||||
</h4>
|
||||
<h5 style="color: #333; font-family: Arial, sans-serif;">If you have any questions or concerns about your order, feel free to reply to this email.
|
||||
</h5>
|
||||
<h5 style="color: #333; font-family: Arial, sans-serif;">Thank you for choosing Smellika! We hope to serve you again soon.
|
||||
<h5 style="color: #333; font-family: Arial, sans-serif;">Thank you for choosing Tavisa! We hope to serve you again soon.
|
||||
|
||||
</h5>
|
||||
<br/>
|
||||
<span style="color: #555; font-size: 13px;">Best regards,</span><br/>
|
||||
|
||||
<span style="color: #555; font-size: 13px;">Team Smellika</span>`,
|
||||
<span style="color: #555; font-size: 13px;">Team Tavisa</span>`,
|
||||
});
|
||||
|
||||
return res
|
||||
|
@ -50,12 +50,12 @@ const orderSchema = new mongoose.Schema(
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
company_name: {
|
||||
type: String,
|
||||
},
|
||||
gst_number: {
|
||||
type: String,
|
||||
},
|
||||
// company_name: {
|
||||
// type: String,
|
||||
// },
|
||||
// gst_number: {
|
||||
// type: String,
|
||||
// },
|
||||
addressId: {
|
||||
type: mongoose.Schema.ObjectId,
|
||||
ref: "ShippingAddress",
|
||||
|
@ -38,19 +38,19 @@ const shippingAddressSchema = new mongoose.Schema(
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
company_name: {
|
||||
type: String,
|
||||
},
|
||||
gst_number: {
|
||||
type: String,
|
||||
validate: {
|
||||
validator: function (v) {
|
||||
// Regular expression for Indian GST number validation
|
||||
return /^(\d{2}[A-Z]{5}\d{4}[A-Z]{1}\d[Z]{1}[A-Z\d]{1})$/.test(v);
|
||||
},
|
||||
message: (props) => `${props.value} is not a valid Indian GST number!`,
|
||||
},
|
||||
},
|
||||
// company_name: {
|
||||
// type: String,
|
||||
// },
|
||||
// gst_number: {
|
||||
// type: String,
|
||||
// validate: {
|
||||
// validator: function (v) {
|
||||
// // Regular expression for Indian GST number validation
|
||||
// return /^(\d{2}[A-Z]{5}\d{4}[A-Z]{1}\d[Z]{1}[A-Z\d]{1})$/.test(v);
|
||||
// },
|
||||
// message: (props) => `${props.value} is not a valid Indian GST number!`,
|
||||
// },
|
||||
// },
|
||||
default: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
Loading…
Reference in New Issue
Block a user