fix: prepend signature instead of replacing email content
This commit is contained in:
parent
b634063f56
commit
c625206076
@ -479,22 +479,26 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex gap-0.5">
|
<div class="flex gap-0.5">
|
||||||
<Tooltip :text="__('Reply')">
|
<Tooltip :text="__('Reply')">
|
||||||
<Button
|
<div>
|
||||||
variant="ghost"
|
<Button
|
||||||
class="text-gray-700"
|
variant="ghost"
|
||||||
@click="reply(activity.data)"
|
class="text-gray-700"
|
||||||
>
|
@click="reply(activity.data)"
|
||||||
<ReplyIcon class="h-4 w-4" />
|
>
|
||||||
</Button>
|
<ReplyIcon class="h-4 w-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip :text="__('Reply All')">
|
<Tooltip :text="__('Reply All')">
|
||||||
<Button
|
<div>
|
||||||
variant="ghost"
|
<Button
|
||||||
class="text-gray-700"
|
variant="ghost"
|
||||||
@click="reply(activity.data, true)"
|
class="text-gray-700"
|
||||||
>
|
@click="reply(activity.data, true)"
|
||||||
<ReplyAllIcon class="h-4 w-4" />
|
>
|
||||||
</Button>
|
<ReplyAllIcon class="h-4 w-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -144,16 +144,23 @@ const signature = createResource({
|
|||||||
auto: true,
|
auto: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function setSignature(editor) {
|
||||||
|
signature.data = signature.data.replace(/\n/g, '<br>')
|
||||||
|
let emailContent = editor.getHTML()
|
||||||
|
emailContent = emailContent.startsWith('<p></p>')
|
||||||
|
? emailContent.slice(7)
|
||||||
|
: emailContent
|
||||||
|
editor.commands.setContent(signature.data + emailContent)
|
||||||
|
editor.commands.focus('start')
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => showEmailBox.value,
|
() => showEmailBox.value,
|
||||||
(value) => {
|
(value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
newEmailEditor.value.editor.commands.focus()
|
let editor = newEmailEditor.value.editor
|
||||||
|
editor.commands.focus()
|
||||||
if (!newEmail.value && signature.data) {
|
setSignature(editor)
|
||||||
signature.data = signature.data.replace(/\n/g, '<br>')
|
|
||||||
newEmail.value = signature.data
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user