2

how to add activation rule as a contextual add-in when email body has a Link as fallowing

<a href="https://www.abcedf.com/go/?3A%2F%2FsteD%3D" target="_blank">
<span >
<img blockedimagesrc="https://www.abcedf.com/files/blue_lock.png">
 Message 
</span>
</a>

and this rule does not work as contextual add-in

>     <Rule xsi:type="ItemIs" FormType="Read" ItemType="Message" />
>         <Rule xsi:type="ItemHasRegularExpressionMatch" PropertyName="BodyAsHTML" RegExName="BodyFilter"
> RegExValue="https://www\.abcedf\.com/go"  />
DevÁsith
  • 1,072
  • 12
  • 38

3 Answers3

1

In regular expressions slashes ("/") are delimiters, so you need to escape them:

https:\/\/www\.abcedf\.com\/go

By the way, this regular expression is trivial - it looks like all you want to do is an exact string match.

Michael Saunders
  • 2,662
  • 1
  • 12
  • 21
  • `code RegExValue="https:\/\/www\.abcedf\.com\/go" /> ` does not fire contexual add-in. what can be the reason ? – DevÁsith Jun 21 '16 at 04:48
  • I'm not sure what the `o` flag is for but I suspect is it isn't valid. Stru `RegExValue="https:\/\/www\.abcedf\.com/gi"`. This will looks for https://www.abcedf.com globally without case-sensitivity. – Marc LaFleur Jun 23 '16 at 02:04
1

Unfortunately, contextual highlighting is not supported in the scenario you have mentioned.

please refer to https://dev.office.com/docs/add-ins/outlook/contextual-outlook-add-ins, the section header How to launch a contextual add-in

specifically, it states that the addin will show in the bar instead if either of these 2 conditions are true.

-When the entity is a URL or an email address

-When the add-in manifest has a rule with type="ItemHasRegularExpressionMatch" and PropertyName="BodyAsHTML" or PropertyName="SenderSMTPAddress"

If you would like your addin to appear in the bar instead, I would recommend confirming your regex using some regex testing tool, then when you are confidant it is correct, try modifying the manifest.

0

For scenarios like this you can use the ItemHasKnownEntity rule. "Known Entities" are pre-defined elements that Outlook recognized automatically. It saves you from having to build complex regular expressions that are both hard to write and even harder to debug.

The ItemHasKnownEntity rule for the above URL might be

<Rule xsi:type="ItemHasKnownEntity" 
EntityType="Url" 
RegExFilter="abcdef"
FilterName="abcdef"
IgnoreCase="true" />
Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63