OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
690 stars 95 forks source link

Images are not attached to the signature in the onMessageSend event in Outlook Online and the new Outlook #4716

Open barisbikmaz opened 4 months ago

barisbikmaz commented 4 months ago

Provide required information needed to triage your issue

We are listening to the "OnMessageSend" event in our Outlook addin. While the message is send, we are inserting the signature for the user. We realized that in Office Online (and in the new Outlook) inline images are missing in the received signature.

Your Environment

Expected behavior

Inline images in signatures shoud be shown to the mail recipient.

Current behavior

When inserting the Signature "OnMessageNew" the signature looks like this image

When inserting the signature again with the "OnMessageSend" event the received signature looks like this image

Link to live example(s)

Run following code when the "OnMessageSend" event is triggered.

function testOnSend() {
    const signature = `<p>Greetings John Doe</p>
<img src="cid:homer.jpg" width="100" />`;

    if (!Office.context.mailbox.item) {
        return;
    }

    const item = Office.context.mailbox.item;

    return new Promise(resolve => {
        item.addFileAttachmentFromBase64Async(
            imageBase64,
            'homer.jpg',
            { isInline: true },
            () => {
                item.body.setSignatureAsync(
                    signature,
                    {
                        coercionType: Office.CoercionType.Html,
                    },
                    () => resolve(true),
                );
            },
        );
    });
}

await testOnSend();
neprasad-microsoft commented 4 months ago

Hi @barisbikmaz Can you confirm if this works on New Outlook on Windows? Also please collect the logs and share it with us. https://github.com/OfficeDev/office-js/wiki/Collecting-log-files-for-Outlook-Add%E2%80%90ins-issues If possible, share your add-in manifest with us. This will help in faster debugging. You can share the files in a private repo and give access to exextoc.

barisbikmaz commented 4 months ago

@neprasad-microsoft Added all the log files for Office Online to https://github.com/barisbikmaz/onsend-issue/

I can currenly not check on the new outlook because my side loaded addin is not running on it. Currently don't know the reason why because it is running on classic Outlook and on the web.

barisbikmaz commented 4 months ago

@neprasad-microsoft Today apps in the new Outlook are working again and I could test the signature. The same problem as in Outlook Online happens also with the new Outlook. Inline images which are added in the OnSend event are not shown in the signature.

anjalitp commented 3 months ago

Thanks for reporting this issue regarding Signature API. It has been added to our backlog. We unfortunately have no timelines to share at this point.

Internal tracking ID: 4779537