mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
fix: incorrect sender name on email meta (#10837)
Fixes https://github.com/chatwoot/chatwoot/issues/10807
This commit is contained in:
@@ -26,7 +26,18 @@ const ccEmail = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const senderName = computed(() => {
|
const senderName = computed(() => {
|
||||||
return sender.value.name ?? '';
|
const fromEmailAddress = fromEmail.value[0] ?? '';
|
||||||
|
const senderEmail = sender.value.email ?? '';
|
||||||
|
|
||||||
|
if (!fromEmailAddress && !senderEmail) return null;
|
||||||
|
|
||||||
|
// if the sender of the conversation and the sender of this particular
|
||||||
|
// email are the same, only then we return the sender name
|
||||||
|
if (fromEmailAddress === senderEmail) {
|
||||||
|
return sender.value.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
const bccEmail = computed(() => {
|
const bccEmail = computed(() => {
|
||||||
@@ -59,11 +70,19 @@ const showMeta = computed(() => {
|
|||||||
:class="hasError ? 'text-n-ruby-11' : 'text-n-slate-11'"
|
:class="hasError ? 'text-n-ruby-11' : 'text-n-slate-11'"
|
||||||
>
|
>
|
||||||
<template v-if="showMeta">
|
<template v-if="showMeta">
|
||||||
<div v-if="fromEmail[0]">
|
<div
|
||||||
<span :class="hasError ? 'text-n-ruby-11' : 'text-n-slate-12'">
|
v-if="fromEmail[0]"
|
||||||
{{ senderName }}
|
:class="hasError ? 'text-n-ruby-11' : 'text-n-slate-12'"
|
||||||
</span>
|
>
|
||||||
<{{ fromEmail[0] }}>
|
<template v-if="senderName">
|
||||||
|
<span>
|
||||||
|
{{ senderName }}
|
||||||
|
</span>
|
||||||
|
<{{ fromEmail[0] }}>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
{{ fromEmail[0] }}
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="toEmail.length">
|
<div v-if="toEmail.length">
|
||||||
{{ $t('EMAIL_HEADER.TO') }}: {{ toEmail.join(', ') }}
|
{{ $t('EMAIL_HEADER.TO') }}: {{ toEmail.join(', ') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user