Gmail — Reply
Gmail — Reply
Section titled “Gmail — Reply”Type: gmail-reply · Package: Gmail v1.0.4 · Output: string
Replies to an existing email within the same thread. Unlike Send, it keeps the subject and the conversation, and by default it replies to the sender only.
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.
Set in id the email you are replying to (from Get emails). The activity:
- Reads the original’s headers (sender, recipients, subject,
Message-ID). - Addresses the reply to the original’s sender. With
replyAll, it also copies (Cc) every recipient and Cc of the original, except your own address. - Uses the subject with the
Re:prefix (not repeated if already there) and links the reply to the original, so Gmail and the recipient’s client show it in the same conversation. - Sends it from the session’s account and returns its ID.
The body is only your text (body): the original message is not quoted below it. To include it, take it from Get email by ID and add it to body.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | — | ID of the email to reply to. |
body | string | — | Reply body. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanGmailSession | — | Gmail — Connect session (inherited inside body). |
isHtml | bool | false | If true, the body is interpreted as HTML. |
replyAll | bool | false | If true, also replies to all recipients and Cc of the original. |
attachments | string | List | — | Path of one file, or a list of paths, to attach. |
Output
Section titled “Output”Returns a string with the reply message ID. Assign it to a variable if you need it later (for example, to label it); otherwise you can ignore it.
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. |
Attachment file not found. | A path in attachments does not exist on the robot’s machine. |
ParseException error while reading an address | The sender or a recipient of the original has no valid address (for example, system notices without a real From). Filter those emails out in the query. |
Example
Section titled “Example”Gmail — Connect credential = credential("gmail-support") └─ body: Gmail — Get emails query = "is:unread in:inbox subject:request" → output: requests For each email in requests └─ Gmail — Reply id = email["id"] body = "We received your request and will contact you within a few hours." → output: replyId Gmail — Mark read/unread id = email["id"]Related activities
Section titled “Related activities”- Gmail — Send — send a new email.
- Gmail — Get emails — find the email to reply to.
- Gmail — Mark read/unread — mark the email as read after replying.
- All Gmail activities