|
|
|
|
@ -444,7 +444,7 @@ export const whatsappMsgTypeMapped = {
|
|
|
|
|
},
|
|
|
|
|
text: {
|
|
|
|
|
type: 'text',
|
|
|
|
|
data: (msg) => ({ id: msg.wamid, text: autoLinkText(msg?.text?.body), originText: msg?.text?.body, title: msg?.customerProfile?.name || msg?.from || '', }),
|
|
|
|
|
data: (msg) => ({ id: msg.wamid, text: autoLinkText(msg?.text?.body), originText: msg?.text?.body, title: msg?.customerProfile?.name || '', }), // msg?.from ||
|
|
|
|
|
renderForReply: (msg) => ({ id: msg.wamid, message: msg?.text?.body }),
|
|
|
|
|
},
|
|
|
|
|
image: {
|
|
|
|
|
@ -612,11 +612,11 @@ export const whatsappMsgTypeMapped = {
|
|
|
|
|
type: 'text',
|
|
|
|
|
data: (msg) => {
|
|
|
|
|
const templateDataMapped = msg.template?.components ? msg.template.components.reduce((r, v) => ({ ...r, [v.type]: v }), {}) : {};
|
|
|
|
|
return { id: msg.wamid, text: autoLinkText(templateDataMapped?.body?.text || `......${(templateDataMapped?.body?.parameters || []).map(pv => pv?.text || '').join('......')}......`), title: msg.template.name };
|
|
|
|
|
return { id: msg.wamid, text: autoLinkText(templateDataMapped?.body?.text || `......${(templateDataMapped?.body?.parameters || []).map(pv => pv?.text || '').join('......')}......`), title: '模板消息', }; // msg.template.name
|
|
|
|
|
},
|
|
|
|
|
renderForReply: (msg) => {
|
|
|
|
|
const templateDataMapped = msg.template?.components ? msg.template.components.reduce((r, v) => ({ ...r, [v.type]: v }), {}) : null;
|
|
|
|
|
return { id: msg.wamid, message: templateDataMapped?.body?.text || templateDataMapped?.body?.parameters?.[0]?.text || '', title: `${msg.template.name}` };
|
|
|
|
|
return { id: msg.wamid, message: templateDataMapped?.body?.text || templateDataMapped?.body?.parameters?.[0]?.text || '', title: '模板消息', }; // `${msg.template.name}`
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
email: {
|
|
|
|
|
|