diff --git a/src/actions/EmailActions.js b/src/actions/EmailActions.js index e5444a7..cd55d6f 100644 --- a/src/actions/EmailActions.js +++ b/src/actions/EmailActions.js @@ -377,7 +377,7 @@ export const updateEmailAction = async (params = { opi_sn: 0, mai_sn_list: [], s * @param {string} [params.remind_type] - Type of reminder. * @param {number} [params.remind_index] - Index of the reminder. */ -export const getEmailTemplateAction = async (params = { coli_sn: 0, lgc: 1, opi_sn: 0, remind_type: '', remind_index: 0 }) => { +export const getReminderEmailTemplateAction = async (params = { coli_sn: 0, lgc: 1, opi_sn: 0, remind_type: '', remind_index: 0 }) => { const { errcode, result } = await fetchJSON(`${API_HOST_V3}/reminder_letter`, params) const { html, bodyContent, bodyText } = parseHTMLString(result?.MailContent, true) ; return errcode === 0 ? {...result, bodyContent }: {} diff --git a/src/hooks/useEmail.js b/src/hooks/useEmail.js index 4ed7afd..7f9ad78 100644 --- a/src/hooks/useEmail.js +++ b/src/hooks/useEmail.js @@ -1,7 +1,7 @@ import { useState, useEffect, useCallback } from 'react' import { isEmpty, objectMapper, olog, } from '@/utils/commons' import { readIndexDB } from '@/utils/indexedDB' -import { getEmailDetailAction, postResendEmailAction, getSalesSignatureAction, getEmailOrderAction, queryEmailListAction, getEmailTemplateAction, saveEmailDraftOrSendAction, updateEmailAction, getEmailChangesChannel, EMAIL_CHANNEL_NAME } from '@/actions/EmailActions' +import { getEmailDetailAction, postResendEmailAction, getSalesSignatureAction, getEmailOrderAction, queryEmailListAction, getReminderEmailTemplateAction, saveEmailDraftOrSendAction, updateEmailAction, getEmailChangesChannel, EMAIL_CHANNEL_NAME } from '@/actions/EmailActions' import { App } from 'antd' import useConversationStore from '@/stores/ConversationStore'; import { msgStatusRenderMapped } from '@/channel/bubbleMsgUtils'; @@ -375,7 +375,7 @@ export const useEmailTemplate = (templateKey, params) => { try { const { index: remind_index, type: remind_type } = emailTemplateMap[templateKey] || {}; const _params = { ...params, remind_index, remind_type}; - const x = await getEmailTemplateAction(_params) + const x = await getReminderEmailTemplateAction(_params) const lowerCaseShallow = Object.keys(x).reduce((acc, key) => ({...acc, [key.toLowerCase()]: x[key]}), {}) setTemplateContent({...lowerCaseShallow, mailtypeName: orderMailTypes.get(lowerCaseShallow.mailtype)}) } catch (networkError) {