Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mark Message as read directly after sending and moving to Sent Items

Featured Replies

Immediately after sending a message with EmailSend and EmailMoveCurrentMessage (to my "Sent Items" folder), how can i immediately mark that sent message as being read?

 

 

Alan,

In order to do this you will need to call EmailOutgoingMessageID after sending to get the message ID then call EmailReadMessages on your "Sent Items" folder and pass in the parameters "readonly=false" and "messageID=$messageID". This will pull in that sent message. Then call EmailGetMessage to iterate to the message. Next, call EmailMessageSetFlag("viewed";"true"). Please note that this will only work with IMAP servers as POP servers do not support message flags. 

  • Author
On 1/6/2017 at 7:00 AM, ryan360Works said:

Alan,

In order to do this you will need to call EmailOutgoingMessageID after sending to get the message ID then call EmailReadMessages on your "Sent Items" folder and pass in the parameters "readonly=false" and "messageID=$messageID". This will pull in that sent message. Then call EmailGetMessage to iterate to the message. Next, call EmailMessageSetFlag("viewed";"true"). Please note that this will only work with IMAP servers as POP servers do not support message flags. 

Ryan,

Thank you for the reply. I have tried to set that up as you directed.  Script does send email and move message to "Sent Items" folder, but does not successfully mark it as read.

 

Here is what I have.  Does this look correct?

 

Thanks!

 

Set Field [ PluginExample::_result; EmailCreate( PluginExample::From ; $CurrentEmailAddress ; PluginExample::Subject)
and
EmailSetBody( PluginExample::Body )
and
EmailAttachFile( $OutputFileName ) ]

Set Field [ PluginExample::_result; EmailSend (
"progress=" & PluginExample::Progress Bar ;
"progresslocation=" & PluginExample::Progress Location )
and
EmailMoveCurrentMessage ( "Sent Items" ) ]

#get message id from what was just sent
Set Variable[ $messageID; EmailOutgoingMessageId ]

Set Field [ PluginExample::_result; EmailReadMessages(
"readonly=false";
"messageID=$messageID";
"mailbox=SENT ITEMS" ;
"max=1") ]

#Iterate to message
Set Field [ PluginExample::_result; EmailGetNextMessage ]
#Mark as read
Set Field [ PluginExample::_result; EmailMessageSetFlag( "viewed";"true" ) ]

Edited by alanf

Alan,

Your script looks correct. I recommend stepping through the script and making sure that you are getting "1" when EmailGetNextMessage is called. If you are not getting a "1", then the message is not getting read in. If you do get a "1", add a EmailReadMessageValue after the EmailGetNextMessage call and pass in a value that you can use to identify the message to make sure that it is the correct one. 

Another thing to check would be to make sure you are getting the message ID. EmailGetOutgoingMessageID returns the message ID or "" if there is no message. I also recommend adding some error checking/data validation to your script.

  • 1 year later...

@alanf did you ever get this working?


I'm trying to do the same and can't seem to figure it out. 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.