Gmail — Mark read/unread
Gmail — Mark read/unread
Section titled “Gmail — Mark read/unread”Type: gmail-mark-read · Package: Gmail v1.0.4 · Output: —
Marks an email as read or unread. Useful to avoid processing a handled email again: after handling it, mark it as read and the next is:unread search won’t bring it back.
How it works
Section titled “How it works”It works on the session created with Gmail — Connect. Pass it in the session parameter, or place this activity inside the body of Gmail — Connect to inherit it automatically.
By default it marks as read (removes the UNREAD label). Turn on unread to mark it as unread (adds the label). It is idempotent: marking an already-read email as read changes nothing and does not fail.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | — | Message ID. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanGmailSession | — | Gmail — Connect session (inherited inside body). |
unread | bool | false | If true, marks as unread; if false, as read. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'id' is required. | id is empty or the expression returned null. |
Requested entity was not found. | No email with that ID exists in the mailbox. |
Example
Section titled “Example”Gmail — Connect credential = credential("gmail-support") └─ body: Gmail — Get emails query = "is:unread in:inbox" → output: newEmails For each email in newEmails └─ Gmail — Download attachments id = email["id"] folder = "C:\inbox" Gmail — Mark read/unread id = email["id"]Related activities
Section titled “Related activities”- Gmail — Get emails — find unread emails.
- Gmail — Reply — reply before marking as read.
- Gmail — Apply label — label the processed email.
- All Gmail activities