From 842e9441dd2c7e1597895b4c038ea1c3adda2500 Mon Sep 17 00:00:00 2001 From: Alaguraj0361 Date: Fri, 5 Jun 2026 17:46:53 +0530 Subject: [PATCH] update email text and remove logo attachment --- mailer.js | 26 ++++---------------------- shipping-label-test.pdf | Bin 57610 -> 57607 bytes 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/mailer.js b/mailer.js index 5f8e102..af8f7f6 100644 --- a/mailer.js +++ b/mailer.js @@ -30,10 +30,8 @@ const sendEmailWithAttachment = async (toEmail, orderData, pdfBuffer, shippingLa // Check if local logo exists for CID inline attachment const localLogoPath = path.join(__dirname, 'logo.png'); const logoExists = fs.existsSync(localLogoPath); - // Use cid:store_logo in HTML - Gmail renders CID attachments correctly - const logoImgTag = logoExists - ? `rayaarishop` - : `rayaarishop`; + // Use a remote URL if you have one, or stick to text fallback to avoid the "logo.png" attachment pill + const logoImgTag = `RAY AARI SHOP`; // --- 1. Generate Order Summary Rows HTML --- let orderRowsHtml = ''; @@ -219,14 +217,6 @@ const sendEmailWithAttachment = async (toEmail, orderData, pdfBuffer, shippingLa } ]; - if (logoExists) { - customerAttachments.push({ - filename: 'logo.png', - path: localLogoPath, - cid: 'store_logo' - }); - } - // --- Seller attachments: Invoice PDF only --- const sellerAttachments = [ { @@ -236,14 +226,6 @@ const sendEmailWithAttachment = async (toEmail, orderData, pdfBuffer, shippingLa } ]; - if (logoExists) { - sellerAttachments.push({ - filename: 'logo.png', - path: localLogoPath, - cid: 'store_logo' - }); - } - try { // 1. Send to customer (Invoice only) const customerMail = await transporter.sendMail({ @@ -262,8 +244,8 @@ const sendEmailWithAttachment = async (toEmail, orderData, pdfBuffer, shippingLa const sellerMail = await transporter.sendMail({ from: `"${process.env.SHOP_NAME || 'Your Store'}" <${process.env.SMTP_FROM_EMAIL}>`, to: sellerEmail, - subject: `[NEW ORDER] #${orderNumber} - Invoice & Shipping Label`, - text: `New order #${orderNumber} received. Invoice and Shipping Label attached.`, + subject: `[NEW ORDER] #${orderNumber} - Invoice`, + text: `New order #${orderNumber} received. Invoice attached.`, html: htmlTemplate, attachments: sellerAttachments }); diff --git a/shipping-label-test.pdf b/shipping-label-test.pdf index 7041d1cda744aef1e8aaf983daa8105d0cc32858..60209b3f266921032fa783f5b99c8cb51fd06bbf 100644 GIT binary patch delta 1516 zcmeA=#N2*}d4mQcqtRqdMwR-LeYf2N_I}p>#eOHax|Eq&Hb>pDh~vSTJ54e?y(}yz zR0?=h_RE({p5oShJXX$Pnx4|`8#P~FU3KCTR`FPG;3%|gOYNLnhEp%`|G(#Jo?rg| z&%V2VKOKI(<*!9z*8Tq5_RIgKoD|xrs+iF>qpJ#bZJulSwqPR8&iTX^qSbw0~ zVAEtTR<8*!3tG0W&DvG{`EyD6j^=6JD*88S+WsdNor>YUHj}BbWm?z%HX6mMgOp=r31vZCn_f_)U z-nPxSWMfhWKkt@>xx8yHZL@s5#q+GGGkbew?qrEeYp?q*+IMN4aM`B4n~fVMapwBp zkzoI;6o{FvJKr^PURC#1p%lB{ zDkqAjy>RXbHJVX!W68Eddd3-SVYiGoT%6b0*x8%FXVloSGPi!M$;IgF7q#E~%3Za! zcJj2Vl@C>JmG+s%>4xd^T&O(Kt}Qqz-K6yBk(8Yw_63DL`InIAQa zw%C>BB+9KHCQ`PV6fFzAWnV>g9#m30KRKWf@*1X3DhAY&>i;AuWC1lZO|={LJ2* zajcqiV&(r|$%nL+uTJM>_-s?Ex7zvr$ED(1v#K?XZQq9^8#!-IZeOM@duvMlvp|P$ zpBx;1+x=egrmy$O%$SOcH_RKNEVbpk{9@a;iRnh&W-ybDo_{l{?DuEm+u=FI(*pKA zy>RVv>d9B9PiE)MczftE+tyeR9q& zQro6|yL?kx@-&^hGmL8Q?RfTaF6-t#>Ee2GDU)qy4$ml+*|;u-M>1OP@v*JSvd%f$ z;?BqB;i_>DtZ#*=x<$Dpnx!Cnm)lSMKo zS+;uAt4X*R9nAPx)FJ%2!)p!OE;cLINAH9>ce5+KG`+yH!9(TUQRPB?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