KAPOW

Would you like to react to this message? Create an account in a few clicks or log in to continue.
KAPOW

Welcome to the Kapow forum. Here you can get help, use your skills to help others and enjoy hanging out in the company of other Kapow Robot Developers.


2 posters

    [solved]Exhange Web Service - Mark Mail as Read in Design Studio

    avatar
    Hawken


    Posts : 3
    Points : 1724
    Join date : 2019-08-16

    [solved]Exhange Web Service - Mark Mail as Read in Design Studio Empty [solved]Exhange Web Service - Mark Mail as Read in Design Studio

    Post by Hawken Fri Aug 16, 2019 3:39 pm

    Hello. We hare using EWS in Our robots for sending mail, replying to mail, download attachments and so on.

    When the robot is sending an email and move it to a specified folder it doesnt mark it as read. Does anyone know the code for this?

    Here is an example of the code used to move email from one folder to another:

      <soap:Header>
        <t:RequestServerVersion Version="Exchange2013" />
      </soap:Header>
      <soap:Body>
        <m:MoveItem>
          <m:ToFolderId>
          </m:ToFolderId>
          <m:ItemIds>
          </m:ItemIds>
        </m:MoveItem>
      </soap:Body>
    </soap:Envelope>

    That code is put in a "set base content" step in design studio
    batman
    batman


    Posts : 47
    Points : 1923
    Join date : 2019-03-19

    [solved]Exhange Web Service - Mark Mail as Read in Design Studio Empty Re: [solved]Exhange Web Service - Mark Mail as Read in Design Studio

    Post by batman Fri Aug 16, 2019 3:51 pm

    If you have the item id and change key for the message you can use the UpdateItem call and set the Message -> isRead property to true - see below for the SOAP syntax and fill in the itemID/ChangeKey when building the expression

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
    <t:RequestServerVersion Version="Exchange2010_SP1" />
    </soap:Header>
    <soap:Body>
    <m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
    <m:ItemChanges>
    <t:ItemChange>
    <t:ItemId Id="" ChangeKey="" />
    <t:Updates>
    <t:SetItemField>
    <t:FieldURI FieldURI="message:IsRead" />
    <t:Message>
    <t:IsRead>true</t:IsRead>
    </t:Message>
    </t:SetItemField>
    </t:Updates>
    </t:ItemChange>
    </m:ItemChanges>
    </m:UpdateItem>
    </soap:Body>
    </soap:Envelope>

    Example expression to build the SOAP request (includes two variables ItemID and ChangeKey which contain the references to the original message.

    >><?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
    <t:RequestServerVersion Version="Exchange2010_SP1" />
    </soap:Header>
    <soap:Body>
    <m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
    <m:ItemChanges>
    <t:ItemChange>
    <t:ItemId Id="<< + InboundEmail.ItemID + >>" ChangeKey="<< + InboundEmail.MessageChangeKey + >>" />
    <t:Updates>
    <t:SetItemField>
    <t:FieldURI FieldURI="message:IsRead" />
    <t:Message>
    <t:IsRead>true</t:IsRead>
    </t:Message>
    </t:SetItemField>
    </t:Updates>
    </t:ItemChange>
    </m:ItemChanges>
    </m:UpdateItem>
    </soap:Body>
    </soap:Envelope><<

    Also check out https://smarthub.kofax.com/ there's a few snippets and example robot on here for EWS integration that includes ingesting, sending and changing the read status of a message

    avatar
    Hawken


    Posts : 3
    Points : 1724
    Join date : 2019-08-16

    [solved]Exhange Web Service - Mark Mail as Read in Design Studio Empty Re: [solved]Exhange Web Service - Mark Mail as Read in Design Studio

    Post by Hawken Fri Sep 06, 2019 8:29 pm

    Hello. I did not have time to try it out before today, but I made it work. Thank you for good explanation and fast reply Smile

    Sponsored content


    [solved]Exhange Web Service - Mark Mail as Read in Design Studio Empty Re: [solved]Exhange Web Service - Mark Mail as Read in Design Studio

    Post by Sponsored content


      Current date/time is Sun Apr 28, 2024 9:44 am