Put imap mail in read

hi all,

i’ve the activity read imap in init state of REFramework.
I read the first 20 emails which I then process one at a time within the process state.

What I would like is to put the mail in the “read” state only at the end of the process. Is this possible somehow considering that my transaction item is of type mailmessage?

hey,

Use the Activity Get Imap mail message it will give the value in the form of List
you should pass through Transaction Data
make the Change the variable of Transaction Item- System.net.mailmaessage
and Transaction Data- List

It will work

Thanks

yep, that’s done.

My question is, can i put, the mail message of transaction item, in “read state”, at the end of the process state, instead of the init state?

There is no need to put the read state State after process transaction state
already we are reading the mail In Init state
Because we are executing the mail one by one
it is better to use Init state to read the mail

Thanks

sorry maybe I expressed myself wrongly.

I will continue to read the emails in the init.

What I would like, is to put in “read” status the mail in the init if and only if the transaction was successful.

if you will do like that than again it will read all the mails so thats why after Completing the process transaction state it is going to get transaction state here it will will start with one by one consecutive number of mails

thanks

does this not work?

image

if you want to mark it as read at the end, you will need to use get emails again at the end and mark as read

Hi @Kumar802

If I am right you need to set the Transaction Status as Read For the Mails that have been Processed?

Regards
Praveen Kumar P

yes, exactly.
But I can’t, for example, put in “read state” top 1 because in the meantime other mails may have arrived

Hello,

If I understood your requirement correctly, you want to update the transaction status as “read” instead of “success”?
If this is the case, you can change the following in the Transaction Status workflow in Process stare and in Success Branch follow the steps in the images.


Let me know if that’s not your request.

I want to put the email just handled in the process in read state

Read state means you want to mark the email as “read” in inbox?

yep, exactly

this is the solution

what if a new email came in in the meantime? and i set top 1? wouldn’t it take the same email that was just handled

Once you read mail message with imap, it won’t modify anything to new mails rather than the mail it already reads using the activity you have to re-run the activity to read new mails.