Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some HTML tags are getting stripped in appendOnSendAsync in outlook for web #4460

Open
tallen1114 opened this issue May 15, 2024 · 3 comments
Assignees
Labels
Area: Outlook Issue related to Outlook add-ins Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown

Comments

@tallen1114
Copy link

Certain HTML tags are being stripped when calling appendOnSendAsync from Outlook Web

Your Environment

  • Platform [PC desktop, Mac, iOS, Office on the web]: Office on the web
  • Host [Excel, Word, PowerPoint, etc.]: Outlook
  • Office version number: 16.84.2 (24042814)
  • Operating System: Mac and Windows
  • Browser (if using Office on the web): Chrome, Safari, and Edge

Expected behavior

HTML that is sent to appendOnSendAsync gets appended to the end of the email, unchanged

Current behavior

Certain tags are being removed from the html

Steps to reproduce

  1. Call appendOnSendAsync and pass in html such as <span><br id="myId"></span>
  2. Send the email from Outlook for Web
  3. View the email once it's been sent, and only <br> was appended.

Provide additional details

This works when sending from a Desktop Client, but behaves differently on Web.

Here's how we're calling appendOnSendAsync:

public appendOnSend(html: string): Promise<Office.AsyncResult<void>> {
        return new Promise<Office.AsyncResult<void>>((resolve, reject) => {
            (Office.context.mailbox.item.body as any).appendOnSendAsync(
                html,
                { coercionType: Office.CoercionType.Html },
                (asyncResult) => {
                    if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
                        resolve(asyncResult);
                    } else if (asyncResult.error) {
                        reject(asyncResult.error);
                    } else {
                        reject(asyncResult);
                    }
                }
            );
        });
    }

This is the html parameter that gets passed into that function:
"<p class="MsoNormal" style="display:none; overflow:hidden; visibility:hidden; line-height:0; font-size:0; max-height:0; max-width:0;"><img src="url-for-image" style="display: none; border: 0; width: 0; height: 0; overflow: hidden;" width="0" height="0" border="0"><br id="yw-custom-id">&nbsp;</p>"

And this is what ends up getting appended to the body once the email is sent - some of the styles are gone, as well as the id on the br tag:
<p style=3D"line-height: 0; max-width: 0px; max-height: 0px; font-size: 0px;"><img style=3D"width: 0px; height: 0px; margin-top: 0px; margin-bottom: 0px;" src=3D"url-for-image"><br>

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label May 15, 2024
@exextoc exextoc added Needs: attention 👋 Waiting on Microsoft to provide feedback Area: Outlook Issue related to Outlook add-ins and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels May 15, 2024
@exextoc exextoc self-assigned this May 15, 2024
@rajjha-msft
Copy link

Hey @tallen1114

Thank you for reporting the issue around AppendOnSend feature on Outlook for Web.
We have put it in our backlog, and unfortunately have no timelines to share.

Internal tracking id : 279321

@rajjha-msft rajjha-msft added Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels May 22, 2024
@tallen1114
Copy link
Author

Thanks @rajjha-msft
This is causing a huge impact to our users 😭 Any ideas for workarounds? We're trying to insert flags into the html body of the message in a way that won't be visible to recipients. This used to work...

@rajjha-msft
Copy link

Rest assured that we are currently prioritizing the resolution of the issue you have brought to our attention. We appreciate your patience and apologize for any inconvenience this may have caused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Outlook Issue related to Outlook add-ins Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown
Projects
None yet
Development

No branches or pull requests

3 participants