Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Configure HTML body for ms-outlook://compose body parameter for Outlook for iOS

UPDATE - 2/26/2020 One of our clients just got this back from Microsoft:

Thank you for submitting this issue to the Outlook for iOS and Android team. After careful consideration, the product team is maintaining it's decision to disable HTML within Outlook Mobile deeplinks. While HTML within deeplinks was previously allowed, support for this scenario was never formally designed or introduced. Additionally, supporting HTML within deeplinks can introduce unintended consequences and potential security issues.

Though not officially supported, deeplinks that utilize plain-text will continue to work in Outlook for iOS and Android. Please note that this behavior may be modified at any time without notice.

Using the UIActivityViewController to share your HTML body also no longer works. It would appear that Microsoft has taken away our ability to generate any HTML bodies when composing an email in their system.

UPDATE - 2/6/2020 As responses show, it's gone from fixed to broken again. One of our large custom app clients that uses outlook exclusively has been pursuing a ticket with MS and this week finally got a response that multiple companies have reported on this issue and they are looking into a way to securely allow sharing of HTML bodies. In the interim for iOS apps we've been converting our code to use the UIActivityViewController and excluding almost all the activityTypes. This allows you to set the HTML body:

let items = [["Body" : emailBody]]

let acv = UIActivityViewController(activityItems: items, 
                           applicationActivities: nil)

The two issues with this approach, is a) If you try and set the subject or recipients, those are ignored. I've tried multiple different ways with no success. So in the case of our apps where for reporting purposes we collect the contact info before the email is sent, the user is required to again enter the contact info in the Outlook message composer. b) It adds an extra step of requiring the user to select Outlook as the share item from the Initial UIActivityViewController. We've had to deal with reported "bugs" that are not bugs, just users not selecting Outlook.

UPDATE - 12/12/2019 The issue appears to have been fixed by Microsoft as my Outlook version remains 4.15.0 but when asked today to make screens shots for a ticket I submitted, the links are now being encoded correctly again. Please vote to close.

Original Question/Issue

I was previously using instructions based on this post. But it appears that with Outlook for iOS version 4.14.x and up (Outlook version tested as of this post 4.15.0) the encoded HTML body is being stripped of all of its encoded characters. Which is to say that something like:

<br>
<a href="www.somelink.com">Some Link</a>
<br>

Becomes

braref=www.somelink.comSomeLink/abr

Hoping someone from the iOS Outlook team sees this post and can perhaps provide some guidance on how one might configure an HTML body to be passed through the ms-outlook://compose body parameter. Or if anyone else has figured it out. Please respond. Thanks!

like image 286
jhelzer Avatar asked Dec 09 '19 21:12

jhelzer


Video Answer


2 Answers

In v4.19.0 (latest version) "less than" and "greater than" signs (< >) are back but the html body is not rendered, so emails looks like this:

<html><body><p><strong>Hi</strong>, how are you</p></body></html>

like image 91
Hector Avatar answered Oct 03 '22 23:10

Hector


We have seen this go from fixed to unfixed, etc. Some days it seems to work and other days it does not. Today it seems broken again.

like image 29
user1821431 Avatar answered Oct 04 '22 00:10

user1821431