none
Getting UniqueBody of a reply with EWS managed API RRS feed

  • Question

  • I've created a streaming subscription to listen for incoming messages to a certain email address inbox. Whenever a new notification is receives, I check if this is a new email. If so, I check whether InReplyTo is null. If not, I know that this is a response to an email I sent before.

    When I confirm that this new email is a reply, I wish to read the unique body of the reply. This means that I do NOT wish to receive the body of the parent email. I've tried binding the email wit ha specific property set including EmailMessageSchema.UniqueBody, but if I debug my way through, I can clearly see that this is NOT unique, but instead I receive the entire conversation body.

    Is there not a way for me to receive the UNIQUE body of my reply?

    if(notification.EventType in EventType.NewMail)
    {
      var item = (ItemEvent)notification;
      var props = new PropertySet(BasePropertySet.IdOnly,
        EmailMessageSchema.UniqueBody,
        EmailMessageSchema.From,
        EmailMessageSchema.Subject
        /* And so on*/ );
    
      props.RequestedBodyType = BodyType.HTML;
    
      // Bind the message
      var message = EmailMessage.Bind(subscription.Service, item.ItemId, props);
    
      var body = message.UniqueBody.Text; //IS NOT VERY UNIQUE?
    }

    Wednesday, March 15, 2017 7:33 AM