const orderConfirmation = (orderObj)=>{
    return `<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>
        <table style="height:100%!important;width:100%!important;border-spacing:0;border-collapse:collapse; font-family:Roboto,sans-serif,HelveticaNeue;">
            <tbody>
                <tr>
                    <td>
                        <table style="width:100%;border-spacing:0;border-collapse:collapse;margin:40px 0 20px">
                            <tbody>
                                <tr>
                                    <td>
                                        <center>
                                            <table style="width:560px;text-align:left;border-spacing:0;border-collapse:collapse;margin:0 auto">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <table style="width:100%;border-spacing:0;border-collapse:collapse">
                                                                <tbody>
                                                                    <tr>
                                                                        <td><img alt="Shopperr B2B" width="180" src="https://ci6.googleusercontent.com/proxy/nsCux16LG-KJr2kdXGYGTZzUzLG0acSNjVIwinbSiNmDucOYc4rTdKsFh8nRram4Xaim24UxGQxk4wn5XdHZIqHUaPGlnDCyGsqD0aykm2aResljeym3Pr9lo57j9XbeGT1yqqcCtgSLOU06ew=s0-d-e1-ft#https://cdn.shopify.com/s/files/1/0317/5999/0924/email_settings/brandmark-design.png?27362" class="CToWUd"> </td>
                                                                        <td align="right" style="text-transform:uppercase;font-size:14px;color:#999"> <span style="font-size:16px">Order #${orderObj.orderId}
            </span></td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </center>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table style="width:100%;border-spacing:0;border-collapse:collapse">
                            <tbody>
                                <tr>
                                    <td style="padding-bottom:40px;border:0">
                                        <center>
                                            <table style="width:560px;text-align:left;border-spacing:0;border-collapse:collapse;margin:0 auto">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <h2 style="font-weight:normal;font-size:24px;margin:0 0 10px">Thank you for your purchase!
            </h2>
                                                            <p style="color:#777;line-height:150%;font-size:16px;margin:0">Hi ${orderObj?.customer?.default_address?.name || ""}, we're getting your order ready to be shipped. We will notify you when it has been sent. </p>
                                                            <table style="width:100%;border-spacing:0;border-collapse:collapse;margin-top:20px">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="line-height:0em">&nbsp;</td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            <table style="border-spacing:0;border-collapse:collapse;float:left;margin-right:15px">
                                                                                <tbody>
                                                                                    <tr>
                                                                                        <td align="center" bgcolor="#ffa000" style="border-radius:4px"> <a href="https://ds.shopperr.in/order-complete/${orderObj?.orderId}" style="font-size:16px;text-decoration:none;display:block;color:#fff;padding:20px 25px" target="_blank" data-saferedirecturl="https://www.google.com/url?q=https://shopperr.in/31759990924/orders/9b59409cf32419cf70ab04c2a7031867/authenticate?key%3Da4e65888c86e1e8b91d54d7074c2baff&amp;source=gmail&amp;ust=1636788930951000&amp;usg=AOvVaw21pMlz03MHueGQ3jhDcU66">View your order</a></td>
                                                                                    </tr>
                                                                                </tbody>
                                                                            </table>
                                                                            <table style="border-spacing:0;border-collapse:collapse;margin-top:19px">
                                                                                <tbody>
                                                                                    <tr>
                                                                                        <td>or <a href="https://ds.shopperr.in" style="font-size:16px;text-decoration:none;color:#ffa000" target="_blank" data-saferedirecturl="https://www.google.com/url?q=https://shopperr.in&amp;source=gmail&amp;ust=1636788930951000&amp;usg=AOvVaw3tilvVP4FFBKkUhewpiDOb">
                                                                                        Visit our store</a> </td>
                                                                                    </tr>
                                                                                </tbody>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </center>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table style="width:100%;border-spacing:0;border-collapse:collapse">
                            <tbody>
                                <tr>
                                    <td style="padding:40px 0">
                                        <center>
                                            <table style="width:560px;text-align:left;border-spacing:0;border-collapse:collapse;margin:0 auto">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <h3 style="font-weight:normal;font-size:20px;margin:0 0 25px">Order summary</h3> </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                            <table style="width:560px;text-align:left;border-spacing:0;border-collapse:collapse;margin:0 auto">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <table style="width:100%;border-spacing:0;border-collapse:collapse">
                                                                <tbody>
                                                                    <tr style="width:100%">
                                                                        <td>
                                                                            <table style="border-spacing:0;border-collapse:collapse">
                                                                                <tbody>
                                                                                    ${
                                                                                        orderObj.products.map((el)=>{
                                                                                            return `<tr>
                                                                                            <td><img align="left" width="60" height="60" style="margin-right:15px;border-radius:8px;border:1px solid #e5e5e5" src="${process.env.S3_BUCKET_FILE_URL}/${el?.imgUrl?.[0]?.src}" class="CToWUd"> </td>
                                                                                            <td style="width:100%"><span style="font-size:16px;font-weight:600;line-height:1.4;color:#555">${el?.name || ""}</span>
                                                                                                <br> </td>
                                                                                            <td style="white-space:nowrap">
                                                                                                <p align="right" style="color:#555;line-height:150%;font-size:16px;font-weight:600;margin:0 0 0 15px"> ₹ ${el?.price || 0} </p>
                                                                                            </td>
                                                                                            </tr>`
                                                                                        })
                                                                                    }
                                                                                </tbody>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                            <table style="width:100%;border-spacing:0;border-collapse:collapse;margin-top:15px;border-top-width:1px;border-top-color:#e5e5e5;border-top-style:solid">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="width:40%"></td>
                                                                        <td>
                                                                            <table style="width:100%;border-spacing:0;border-collapse:collapse;margin-top:20px">
                                                                                <tbody>
                                                                                    <tr>
                                                                                        <td style="padding:5px 0">
                                                                                            <p style="color:#777;line-height:1.2em;font-size:16px;margin:0"><span style="font-size:16px">Subtotal</span> </p>
                                                                                        </td>
                                                                                        <td align="right" style="padding:5px 0"><strong style="font-size:16px;color:#555">₹ ${orderObj?.customer?.total_price_of_products || 0}</strong> </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td style="padding:5px 0">
                                                                                            <p style="color:#777;line-height:1.2em;font-size:16px;margin:0"><span style="font-size:16px">Shipping</span> </p>
                                                                                        </td>
                                                                                        <td align="right" style="padding:5px 0"><strong style="font-size:16px;color:#555">₹ ${orderObj?.customer?.total_shipping_cost || 0}</strong> </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td style="padding:5px 0">
                                                                                            <p style="color:#777;line-height:1.2em;font-size:16px;margin:0"><span style="font-size:16px">Taxes</span> </p>
                                                                                        </td>
                                                                                        <td align="right" style="padding:5px 0"><strong style="font-size:16px;color:#555">₹ ${Math.ceil(parseInt(orderObj?.customer?.total_gst || 0)+parseInt(orderObj?.customer?.total_duty || 0)).toFixed(2)}</strong> </td>
                                                                                    </tr>
                                                                                </tbody>
                                                                            </table>
                                                                            <table style="width:100%;border-spacing:0;border-collapse:collapse;margin-top:20px;border-top-width:2px;border-top-color:#e5e5e5;border-top-style:solid">
                                                                                <tbody>
                                                                                    <tr>
                                                                                        <td style="padding:20px 0 0">
                                                                                            <p style="color:#777;line-height:1.2em;font-size:16px;margin:0"><span style="font-size:16px">Total</span> </p>
                                                                                        </td>
                                                                                        <td align="right" style="padding:20px 0 0"><strong style="font-size:24px;color:#555">₹ ${orderObj?.customer?.total_spent || 0}</strong> </td>
                                                                                    </tr>
                                                                                </tbody>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </center>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table style="width:100%;border-spacing:0;border-collapse:collapse">
                            <tbody>
                                <tr>
                                    <td style="padding:40px 0">
                                        <center>
                                            <table style="width:560px;text-align:left;border-spacing:0;border-collapse:collapse;margin:0 auto">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <h3 style="font-weight:normal;font-size:20px;margin:0 0 25px">Customer information</h3> </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                            <table style="width:560px;text-align:left;border-spacing:0;border-collapse:collapse;margin:0 auto">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <table style="width:100%;border-spacing:0;border-collapse:collapse">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="padding-bottom:40px;width:50%">
                                                                            <h4 style="font-weight:600;font-size:16px;color:#555;margin:0 0 5px">Shipping address</h4>
                                                                            <p style="color:#777;line-height:150%;font-size:16px;margin:0">${orderObj?.shippingAddress?.name || ""}
                                                                                <br> ${orderObj?.shippingAddress?.company || ""}
                                                                                <br> ${orderObj?.shippingAddress?.address1 || ""}
                                                                                <br> ${orderObj?.shippingAddress?.zip || ""} ${orderObj?.shippingAddress?.province || orderObj?.shippingAddress?.province_code || ""}
                                                                                <br> ${orderObj?.shippingAddress?.country || orderObj?.shippingAddress?.country_code || ""}</p>
                                                                        </td>
                                                                        <td style="padding-bottom:40px;width:50%">
                                                                            <h4 style="font-weight:600;font-size:16px;color:#555;margin:0 0 5px">Billing address</h4>
                                                                            <p style="color:#777;line-height:150%;font-size:16px;margin:0">${orderObj?.billingAddress?.name || ""}
                                                                            <br> ${orderObj?.billingAddress?.company || ""}
                                                                            <br> ${orderObj?.billingAddress?.address1 || ""}
                                                                            <br> ${orderObj?.billingAddress?.zip || ""} ${orderObj?.billingAddress?.province || orderObj?.billingAddress?.province_code || ""}
                                                                            <br> ${orderObj?.billingAddress?.country || orderObj?.billingAddress?.country_code || ""}</p>
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                            <table style="width:100%;border-spacing:0;border-collapse:collapse">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="padding-bottom:40px;width:50%">
                                                                            <h4 style="font-weight:600;font-size:16px;color:#555;margin:0 0 5px">Shipping method</h4>
                                                                            <p style="color:#777;line-height:150%;font-size:16px;margin:0">Standard</p>
                                                                        </td>
                                                                        <td style="padding-bottom:40px;width:50%">
                                                                            <h4 style="font-weight:600;font-size:16px;color:#555;margin:0 0 5px">Payment method</h4>
                                                                            <p style="color:#777;line-height:150%;font-size:16px;margin:0"> CashFree — <strong style="font-size:16px;color:#555">₹ ${orderObj?.customer?.total_spent || 0}</strong> </p>
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </center>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table style="width:100%;border-spacing:0;border-collapse:collapse;border-top-width:1px;border-top-color:#e5e5e5;border-top-style:solid">
                            <tbody>
                                <tr>
                                    <td style="padding:35px 0">
                                        <center>
                                            <table style="width:560px;text-align:left;border-spacing:0;border-collapse:collapse;margin:0 auto">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <p style="color:#999;line-height:150%;font-size:14px;margin:0"> If you have any questions, reply to this email or contact us at <a href="mailto:seller.support@creationist.in" style="font-size:14px;text-decoration:none;color:#ffa000" target="_blank">
            seller.support@creationist.in</a></p>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </center>
                                    </td>
                                </tr>
                            </tbody>
                        </table> <img height="1" style="min-width:600px;height:0" src="https://ci4.googleusercontent.com/proxy/C5WAwfRu-nhYYB726ZtDmBBZxH2ZQQgtpxwmJT5KONtMOVp6k7laRdD7JghQXsHLcYM4veQr436syfT22M4kVYeof9oM4TIq5I7li0_YUjrim2hpHv5dYG7V9z9OmFYRRwYK3KgYIf0ck0d_WTq1EjhX_DpBFoi4n20fTmcCfJxl76PIrL1HodOHxbkR8PrieSaJX9F3tcNZb-9L3JTm7_owWlAKVQ64kFMBmJHwK7I=s0-d-e1-ft#https://cdn.shopify.com/shopifycloud/shopify/assets/themes_support/notifications/spacer-1a26dfd5c56b21ac888f9f1610ef81191b571603cb207c6c0f564148473cab3c.png" class="CToWUd"> </td>
                </tr>
            </tbody>
        </table>
    </body>
    </html>`
}

module.exports = {orderConfirmation};