diff --git a/src/views/NewEmail.jsx b/src/views/NewEmail.jsx
index 3ce5f73..055dcc7 100644
--- a/src/views/NewEmail.jsx
+++ b/src/views/NewEmail.jsx
@@ -69,7 +69,7 @@ const generateQuoteContent = (mailData, isRichText = true) => {
return isRichText ? html : parseHTMLText(html)
}
-const generateMailContent = (mailData) => `
${mailData.content}
${mailData.content}
Dear Mr./Ms. ${orderDetail.contact?.[0]?.name || ''}
Reference Number: ${order_no}
` : '') + // setContentPrefix(order_no ? `Dear Mr./Ms. ${orderDetail.contact?.[0]?.name || ''}
Reference Number: ${order_no}
` : '') + const orderPrefix = order_no ? `Dear Mr./Ms. ${orderDetail.contact?.[0]?.name || ''}
Reference Number: ${order_no}
` : '' const { info } = mailData const { ...templateFormValues } = templateContent; @@ -202,8 +203,8 @@ const NewEmail = () => { // const _initialContent = isEmpty(mailData.info) ? signatureBody : signatureBody+preQuoteBody - if (!isEmpty(mailData.info) && !['edit', 'new'].includes(pageParam.action)) { - readyToInitialContent = contentPrefix + signatureBody + if (!isEmpty(mailData.info) && !['edit'].includes(pageParam.action)) { + readyToInitialContent = orderPrefix + signatureBody } switch (pageParam.action) { case 'reply': @@ -239,7 +240,7 @@ const NewEmail = () => { from: quotedMailSenderObj, to: info?.MAI_To || '', cc: info?.MAI_CS || '', - subject: `Fw: ${info.MAI_Subject || ''}`, + subject: `${info.MAI_Subject || ''}`, id: pageParam.quoteid, mai_sn: pageParam.quoteid, ..._form2 @@ -255,7 +256,7 @@ const NewEmail = () => { subject: `${info.MAI_Subject || templateFormValues.subject || ''}`, ..._form2, } - readyToInitialContent = generateMailContent({ content: templateContent.bodycontent || '' }) + readyToInitialContent = generateMailContent({ content: templateContent.bodycontent || readyToInitialContent || '' }) setFileList(mailData.attachments.map(ele => ({ uid: ele.ATI_SN, name: ele.ATI_Name, url: ele.ATI_ServerFile, fullPath: `${EMAIL_ATTA_HOST}${ele.ATI_ServerFile}` }))) break @@ -267,7 +268,7 @@ const NewEmail = () => { setInitialContent(readyToInitialContent); return () => {} - }, [orderDetail.order_no, quoteLoading, loadingTamplate]) + }, [orderDetail.order_no, quoteLoading, loadingTamplate, signature]) // const readFromTemplate = () => {