|
|
|
@ -68,13 +68,13 @@ const generateMailContent = (mailData) => `
|
|
|
|
|
/**
|
|
|
|
|
* @property {string} fromEmail - 发件人邮箱
|
|
|
|
|
* @property {string} fromUser - 发件人用户
|
|
|
|
|
* @property {string} fromOrder - 发件人订单
|
|
|
|
|
* @property {string} fromOrder - 发件订单
|
|
|
|
|
* @property {string} toEmail - 收件人邮箱
|
|
|
|
|
* @property {string} conversationid - 会话ID
|
|
|
|
|
* @property {string} quoteid - 引用邮件ID
|
|
|
|
|
* @property {object} draft - 草稿
|
|
|
|
|
*/
|
|
|
|
|
const EmailEditorPopup = ({ open, setOpen, fromEmail, fromUser, fromOrder, toEmail, conversationid, quoteid, initial = {}, mailData: _mailData, action = 'reply', draft = {}, ...props }) => {
|
|
|
|
|
const EmailEditorPopup = ({ open, setOpen, fromEmail, fromUser, fromOrder, oid, toEmail, conversationid, quoteid, initial = {}, mailData: _mailData, action = 'reply', draft = {}, ...props }) => {
|
|
|
|
|
const { notification, message } = App.useApp();
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
|
|
|
@ -115,7 +115,7 @@ const EmailEditorPopup = ({ open, setOpen, fromEmail, fromUser, fromOrder, toEma
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (isEmpty(quoteid)) {
|
|
|
|
|
// console.log('emailEditorPopup effect', open, '\nto', toEmail)
|
|
|
|
|
setStickToProps({ fromEmail, fromUser, fromOrder, toEmail, conversationid, quoteid, action, draft });
|
|
|
|
|
setStickToProps({ fromEmail, fromUser, fromOrder, oid, toEmail, conversationid, quoteid, action, draft });
|
|
|
|
|
|
|
|
|
|
setStickToCid(conversationid)
|
|
|
|
|
setEmailOrder(fromOrder)
|
|
|
|
@ -408,6 +408,7 @@ const EmailEditorPopup = ({ open, setOpen, fromEmail, fromUser, fromOrder, toEma
|
|
|
|
|
subject: values.subject,
|
|
|
|
|
content: body.mailcontent,
|
|
|
|
|
},
|
|
|
|
|
coli_id: stickToProps.oid || `{${emailOrder}}`
|
|
|
|
|
}
|
|
|
|
|
setSendLoading(true);
|
|
|
|
|
body.externalID = stickToCid;
|
|
|
|
@ -422,6 +423,8 @@ const EmailEditorPopup = ({ open, setOpen, fromEmail, fromUser, fromOrder, toEma
|
|
|
|
|
const result = await postSendEmail(body);
|
|
|
|
|
const mailSavedId = result.id || '';
|
|
|
|
|
bubbleMsg.email.mai_sn = mailSavedId;
|
|
|
|
|
// console.log('invokeEmailMessage', bubbleMsg);
|
|
|
|
|
|
|
|
|
|
invokeEmailMessage(bubbleMsg);
|
|
|
|
|
|
|
|
|
|
// setSendLoading(false);
|
|
|
|
@ -473,7 +476,7 @@ const EmailEditorPopup = ({ open, setOpen, fromEmail, fromUser, fromOrder, toEma
|
|
|
|
|
</Popconfirm>
|
|
|
|
|
<Select labelInValue
|
|
|
|
|
options={emailListOption}
|
|
|
|
|
value={newFromEmail}
|
|
|
|
|
value={{key: newFromEmail, value: newFromEmail, label: newFromEmail}}
|
|
|
|
|
onChange={handleSwitchEmail}
|
|
|
|
|
variant={'borderless'}
|
|
|
|
|
/>
|
|
|
|
|