9

I'm trying to establish if this is even possible:

Can an outlook web add-in (i.e. a JavaScript add-in that works on the web and in outlook, not a COM based add-in) modify the body of an email while in read mode (i.e. the user is reading an email, not composing a new email or replying to an email).

What I need to do is trigger the add-in if the email contains hyperlinks (looks like I can do that with a contextual add-in using a regular expression) and then modify those hyperlinks (change the href or add an onClick event handler) so if the user clicks them the behaviour is different.

Darren
  • 4,408
  • 4
  • 39
  • 57
  • 2
    Currently we don't support any api which can set the body in read mode, as an alternative you can try the solution suggested below. – Outlook Add-ins Team - MSFT May 13 '19 at 08:39
  • 1
    That's a shame @OutlookAdd-insTeam-MSFT, we wanted to add a warning message to our users if they were visiting a non-whitelisted website (trying to stop phishing attempts) – Darren May 13 '19 at 08:55

3 Answers3

3

Based on @OutlookAdd-insTeam-MSFT comment I'll post my own answer:

You cannot modify the body of an email in read mode.

:(

Darren
  • 4,408
  • 4
  • 39
  • 57
1

Cant comment. Not enough rep.

I am looking at the documentation for Read Scenario I dont see anything related to set property.

However I do see something about extracting info from an item, more importantly extracting URL's

May be you can extact URL's do your modifications and with the new content you can create a New message item or even Reply and Reply all

  • 1
    Thanks for the suggestion, but the modifications need to happen to the inbound email in the reading pane. – Darren May 13 '19 at 08:51
0

It should be able to do that using calling UpdateItem via EWS from the add-in, right? See https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/updateitem-operation Why wouldn't that work @microsoft?

Rick Goud
  • 105
  • 5