none
office mail app, activating based on text within html in the body RRS feed

  • Question

  • I was told my one of the presenters are the SharePoint conference that mail content apps would activate based on content within the html tags. for example I have code that adds html like this

    <a href="http://server.com/report?location=%2FShared%20Content%2FFfitnessBubble&type=Report.BI">Resting Heart Rate</a>

    when I add this to the email, it shows up correctly as a link with "Resting Heart Rate" blue and underlined. I can click on it and it takes me to my link as I expect.

    The issue is that when I read this email, my app does not activate when I set "active when email contains a url".

    I have also tried activating on a regular expression, that does not work for "body as html" or "body as text".

    So is this going to be possible? or will the activation only work on text that is visible to the eye.


    Bill Reid

    Wednesday, May 7, 2014 6:23 PM

Answers

All replies

  • Hi Bill,

    To activate a mail app that has URLs embedded in HTML tags, you should use an ItemHasRegularExpressionMatch rule in the app manifest, and specify BodyAsHTML as the PropertyName attribute, and a regular expression that matches URLs as the RegExValue attribute. ItemHasKnownEntity rules can only match URLs that exist explicitly in the item body, and not the ones embedded in HTML tags. If you're interested in reading more about this, see:

    There are also some tips about using ItemHasRegularExpressionMatch rules:

    Hope that helps.

    Angelgolfer

    MSFT Content Developer

    Wednesday, May 7, 2014 11:09 PM
    Answerer
  • yes, I've tried all of those tips, but this is not working. I connect to my office 365 developer account with IE 11. If all I have as my activation rules are Item matches regular expression, Body as plain text with a value of

    http

    if the body of the msg contains an exposed url like

    http://someserver.com

    but if the body is html and it contains a link like

    <a href=http://someserver.com target="_blank" >some text</a>

    such that in the browser, in office 365, while viewing the msg it shows up as

    some text

    as a link does, it does not match it. I guess what I'm trying to do is have it activate on the actual text within the html. This way I can put things like data-myalerttext as attributes on the stuff I add and only activate on them.

    based on the links above I don't think this is possible, but I was told at spc14 that is was.


    Bill Reid

    Friday, May 16, 2014 5:39 PM
  • Hi Bill,

    Can you share your manifest (that shows the activation rules) and the content of your test email please?

    Angelgolfer

    Monday, May 19, 2014 8:48 PM
    Answerer
  • here is the manifest

    <?

    xmlversion="1.0"encoding="UTF-8"?>

    <!--

    Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->

    <

    OfficeAppxmlns="http://schemas.microsoft.com/office/appforoffice/1.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:type="MailApp">

      <

    Id>bc533cd3-7332-4d4a-b81e-c548a701d1cb</Id>

      <

    Version>1.0.0.0</Version>

      <

    ProviderName>SAS Institute Inc.</ProviderName>

      <

    DefaultLocale>en-US</DefaultLocale>

      <

    DisplayNameDefaultValue="SASMailContent"/>

      <

    Capabilities>

        <

    CapabilityName="Mailbox"/>

      </

    Capabilities>

      <

    DesktopSettings>

        <

    SourceLocationDefaultValue="~remoteAppUrl/AppRead/Home/Home.html"/>

        <

    RequestedHeight>250</RequestedHeight>

      </

    DesktopSettings>

      <

    Permissions>ReadItem</Permissions>

      <

    Rulexsi:type="RuleCollection"Mode="And">

        <

    Rulexsi:type="ItemHasRegularExpressionMatch"RegExName="Regex1"RegExValue="http"PropertyName="BodyAsPlaintext"/>

      </

    Rule>

      <

    DisableEntityHighlighting>false</DisableEntityHighlighting>

    </

    OfficeApp>

    if the below is in my email as plain text, ie you can see everything with your eyes, my app gets activated.

    <a href="http://servername/VA/report?location=%2FShared%20SAS%20Content%2FVA%20Reports%2FfitnessBubble&amp;type=Report.BI" target="_blank">Resting Heart Rate</a>

    or if I just have

    "http://servername/VA/report?location=%2FShared%20SAS%20Content%2FVA%20Reports%2FfitnessBubble&amp;type=Report.BI"

    What I am trying to do is to insert the <a ... /a> into an email and just have

    Resting Heart Rate

    show up as a link, have my app  activate and be able to get the html underneath to operate on.


    Bill Reid

    Tuesday, May 20, 2014 2:43 PM
  • Bill, can you clarify again, what do you get if you use PropertyName="BodyAsHTML" instead of  PropertyName="BodyAsPlaintext"? The app doesn't activate?
    Tuesday, May 20, 2014 10:27 PM
    Answerer
  • It appears that the latest update to my office 365 developer tenant has fixed this. Originally neither BodyAsHTML now BodyAsText were working, now BodyAsHTML is working as it should. I've remarked your original post as the answer. I just wish they would give us some indication as to what level the tenant is at and what features will or will not work. There seems to be a slight disconnect as to when things are coming and when they are actually in the field.

    Bill Reid

    Wednesday, May 21, 2014 1:23 PM
  • Hi Bill,

    Glad we found the fix and the mail app is activating. Thank you for your patience. I will try to make sure your input about the current support on the tenant gets to the appropriate product team.

    Angelgolfer

    Wednesday, May 21, 2014 11:48 PM
    Answerer
  • Hi Bill,

    We just announced an active roadmap for Office 365 for business to improve the visibility of service updates for commercial and academic multi-tenant services. I thought about your experience, wanted to let you know about the roadmap and hope it will alleviate some of the disconnect you felt before. Please take a look at this blog post for more information.

    Cheers!

    Angelgolfer

    Thursday, June 19, 2014 8:14 PM
    Answerer
  • thank you, that is great news and already found a feature I've been waiting for in the developing section.

    Bill Reid

    Friday, June 20, 2014 5:35 PM