Skip to content

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.

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:

  1. Reads the original’s headers (sender, recipients, subject, Message-ID).
  2. 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.
  3. 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.
  4. 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.

ParameterTypeDefaultDescription
idstring—ID of the email to reply to.
bodystring—Reply body.
ParameterTypeDefaultDescription
sessionZoanGmailSession—Gmail — Connect session (inherited inside body).
isHtmlboolfalseIf true, the body is interpreted as HTML.
replyAllboolfalseIf true, also replies to all recipients and Cc of the original.
attachmentsstring | List—Path of one file, or a list of paths, to attach.

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.

MessageCause 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 addressThe 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.
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"]