none
Reply to the email using Mail App for Office RRS feed

  • Question

  • Hi,

    I am working on a prototype to create an Mail App for Office. It's required for the approval of the workflow activity. The scenario is, the Manager will receive the approval email from the workflow system. When the user opens the email, the Mail App for Office option is provided with Accept and Reject button in it. Manager can either Accept or Reject the leave application by clicking on the buttons provided on the Agave. Clicking on button will reply to the email with Accept/Reject text added ( depending upon the selection) to the body of the email.

    Please provide how to proceed with this.


    Friday, September 14, 2012 5:51 AM

Answers

  • Actually, I have good news - we were able to add Office.context.mailbox.item.displayReplyForm() and displayReplyAllForm() methods for our RTM bits, which accept a few parameters (including an HTML body) that can be used to pre-populate the reply form. We should have documentation on that coming soon.

    There's no way to access the body of the item without using EWS.

    Saturday, September 29, 2012 1:02 AM

All replies

  • Hi Aggarwal,

    I think whether we need to discuss how to identified which kind of characters of the mail will active your Outlook App?

    T.X.


    志异征诛,三让两家王朝
    功同开辟,一桮万古江南

    Monday, September 17, 2012 2:39 AM
  • Hi,

    I am able write the rules which will activate the Mail Apps for Outlook. There are few keywords and url pattern in the email, specific to the product, which decided whether to display the mail app or not.

    What I am looking for is, how I can reply to the email with the previous email contents.

    something like, say the manager Mike has received the below leave application email:

    ========================================================

    Mr. Mike,

    There is a leave application submitted by Ken. Please act appropiately.

    Leave STARTS from 15-09-2012 till 17-09-2012

    Actions: [  ]   Valid Values: Accept or Reject.

    ========================================================

    When Mike reply to the acceptance of leave application, he will reply with the 'Accept' keywork typed in between brackets [  ] in the leave email received by him, as below:

    ========================================================

    Mr. Mike,

    There is a leave application submitted by Ken. Please act appropiately.

    Leave STARTS from 15-09-2012 till 17-09-2012

    Actions: [ Accept ]   Valid Values: Accept or Reject.

    ========================================================

    Hope the above scenario will clarify the solution I am looking for.

    Monday, September 17, 2012 2:56 AM
  • HI All,

    Or is there is any way I can access the FULL content of the email body from mail apps.

    I have found the code through which we can access ONLY the urls, addresses etc in the email.

    What I am looking for is to get the FULL content of the email.

    Thanks in advance.

    Monday, September 17, 2012 4:07 AM
  • Hi Aggarwal,

    The only way to do this today is pretty complex - you have to use Exchange Web Services (by calling mailbox.makeEwsRequestAsync) and create a reply to the current message. This would make your app admin-install only (though I think that's ok, since it sounds like it needs to be hooked up to a Workflow app?).

    To do this, you would first have to call GetItem EWS request, to get the ItemId and the ChangeKey of the current item (note that you do get the ItemId via a JS API mailbox.item.itemId, but you don't have the ChangeKey). Once you have the ItemId and ChangeKey, you can construct a reply request (and send it) using XML similar to this http://msdn.microsoft.com/en-us/library/dd633704.aspx (scroll down midway to see the resulting XML; use version Exchange2013, NOT 2007_SP1 as in the example).

    Note that we're actively working on simplifying this experience by exposing a simple JS method to create a response.

    -Andrew

    Monday, September 17, 2012 11:13 PM
  • Hi Andrew,

    Thanks for the response.

    I have gone through the link http://msdn.microsoft.com/en-us/library/fp161019(v=office.15).aspx and it states the following drawbacks of using makeEwsRequestAsync:

    1. If the result exceeds 1 MB in size, an error message is returned

    2. You cannot request Folder Associated Items with the makeEwsRequestAsync method

    Is there is any other way to access the content of the email which overcome the drawbacks associated with makeEwsRequestAsync?

    FYI, I am able to access the part of the email body using the regular expression declared as rules.

    <Rule xsi:type="ItemHasRegularExpressionMatch" PropertyName="BodyAsPlaintext" IgnoreCase="true" RegExName="requestId" RegExValue="Workflow:[\S]*"/>

    And reading the regular expression matching content using:

    Office.context.mailbox.item.getRegExMatches().requestId

    Is there is anything similar provided which can return the whole body of the email.

    Regards,

    Ripin Aggarwal

    Tuesday, September 25, 2012 10:03 AM
  • Andrew,

    Do you think that 1MB limitation will be changed in a near future?

    You mentioned : “we're actively working on simplifying this experience by exposing a simple JS method to create a response.”
    How soon can we expect to get these JS methods?

    Thanks and regards,
    Sanja

    Thursday, September 27, 2012 12:22 PM
  • Actually, I have good news - we were able to add Office.context.mailbox.item.displayReplyForm() and displayReplyAllForm() methods for our RTM bits, which accept a few parameters (including an HTML body) that can be used to pre-populate the reply form. We should have documentation on that coming soon.

    There's no way to access the body of the item without using EWS.

    Saturday, September 29, 2012 1:02 AM
  • Hi Sanja,

    We were able to add these methods to our RTM bits. Documentation should be updated soon.

    Are you running into a blocker around the 1MB limit? If so, in which cases?

    -Andrew

    Saturday, September 29, 2012 1:03 AM
  • Hi Andrew,

    You mentioned: "There's no way to access the body of the item without using EWS."

    Is there any plan of adding JS method to access the full email body and/or attachment.

    Regards,

    Ripin

    Saturday, September 29, 2012 3:28 AM
  • Hi Andrew,

    This is very nice news, thank you!

    As for the limitation of 1 MB – I plan to create Office app that saves emails from customers to our document library (then link it to account, etc.). I know that email body can easily exceed 1MB if just a few screen shots are included in the email and that is often the case in our communication with customers.

    We offer similar functionality through Office add-ins but I am sure that our customers will like Office App as they can use it from Outlook Web App as well.

    Regards,
    Sanja

    Monday, October 1, 2012 11:03 AM