Skip to content

Gmail 节点邮件操作#

¥Gmail node Message Operations

使用“消息”操作,在 Gmail 中发送、回复、删除、标记为已读/未读、添加标签、移除标签、获取邮件或获取邮件列表。有关 Gmail 节点本身的更多信息,请参阅 Gmail 节点

¥Use the Message operations to send, reply to, delete, mark read or unread, add a label to, remove a label from, or get a message or get a list of messages in Gmail. Refer to the Gmail node for more information on the Gmail node itself.

为消息添加标签#

¥Add Label to a message

使用此操作向消息添加一个或多个标签。

¥Use this operation to add one or more labels to a message.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择添加标签。

¥Operation: Select Add Label.

  • 消息 ID:请输入要添加标签的消息的 ID。

¥Message ID: Enter the ID of the message you want to add the label to.

  • 标签名称或 ID:选择要添加的标签名称,或输入表达式以指定 ID。下拉列表将根据你选择的凭据自动填充。

¥Label Names or IDs: Select the Label names you want to add or enter an expression to specify IDs. The dropdown populates based on the Credential you selected.

请参阅 Gmail API 方法:users.messages.modify 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.modify documentation for more information.

删除消息#

¥Delete a message

使用此操作立即永久删除消息。

¥Use this operation to immediately and permanently delete a message.

Permanent deletion

此操作无法撤消。对于可恢复的删除操作,请改用 线程回收操作

¥This operation can't be undone. For recoverable deletions, use the Thread Trash operation instead.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择“删除”。

¥Operation: Select Delete.

  • 消息 ID:请输入要删除的消息的 ID。

¥Message ID: Enter the ID of the message you want to delete.

请参阅 Gmail API 方法:users.messages.delete 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.delete documentation for more information.

获取消息#

¥Get a message

使用此操作获取单条消息。

¥Use this operation to get a single message.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择“获取”。

¥Operation: Select Get.

  • 消息 ID:请输入要检索的消息的 ID。

¥Message ID: Enter the ID of the message you wish to retrieve.

  • 简化:选择是否返回简化版响应(已开启)或原始数据(已关闭)。默认值为开启。

¥Simplify: Choose whether to return a simplified version of the response (turned on) or the raw data (turned off). Default is on.

  • 这与将 API 调用的 format 设置为 metadata 相同,它会返回电子邮件消息 ID、标签和电子邮件标头,包括:发件人、收件人、抄送、密送和主题。

    ¥This is the same as setting the format for the API call to metadata, which returns email message IDs, labels, and email headers, including: From, To, CC, BCC, and Subject.

请参阅 Gmail API 方法:users.messages.get 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.get documentation for more information.

获取多个消息#

¥Get Many messages

使用此操作获取两条或多条消息。

¥Use this operation to get two or more messages.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择“获取多个”。

¥Operation: Select Get Many.

  • 返回全部:选择节点是否返回所有消息(已开启)或仅返回不超过设定限制的消息(已关闭)。

¥Return All: Choose whether the node returns all messages (turned on) or only up to a set limit (turned off).

  • 限制:请输入要返回的最大消息数。仅当你关闭“全部返回”时使用。

¥Limit: Enter the maximum number of messages to return. Only used if you've turned off Return All.

  • 简化:选择是否返回简化版响应(已开启)或原始数据(已关闭)。默认值为开启。

¥Simplify: Choose whether to return a simplified version of the response (turned on) or the raw data (turned off). Default is on.

  • 这与将 API 调用的 format 设置为 metadata 相同,它会返回电子邮件消息 ID、标签和电子邮件标头,包括:发件人、收件人、抄送、密送和主题。

    ¥This is the same as setting the format for the API call to metadata, which returns email message IDs, labels, and email headers, including: From, To, CC, BCC, and Subject.

获取多个消息筛选条件#

¥Get Many messages filters

使用这些过滤器进一步优化节点的行为:

¥Use these filters to further refine the node's behavior:

  • 包含垃圾邮件和已删除邮件:选择节点是否应接收垃圾邮件和已删除邮件文件夹中的邮件(开启)或不接收(关闭)。

¥Include Spam and Trash: Select whether the node should get messages in the Spam and Trash folders (turned on) or not (turned off).

  • 标签名称或 ID:仅返回添加了所选标签的消息。选择要应用的标签名称,或输入表达式以指定 ID。下拉列表将根据你选择的凭据自动填充。

¥Label Names or IDs: Only return messages with the selected labels added to them. Select the Label names you want to apply or enter an expression to specify IDs. The dropdown populates based on the Credential you selected.

  • 搜索间隔:输入 Gmail 搜索筛选过滤器(例如 from:)以筛选返回的邮件。有关更多信息,请参阅 在 Gmail 中优化搜索

¥Search: Enter Gmail search refine filters, like from:, to filter the messages returned. Refer to Refine searches in Gmail for more information.

  • 读取状态:选择接收未读邮件和已读邮件、仅接收未读邮件(默认)或仅接收已读邮件。

¥Read Status: Choose whether to receive Unread and read emails, Unread emails only (default), or Read emails only.

  • 接收时间之后:仅返回指定日期和时间之后收到的电子邮件。使用日期选择器选择日期和时间,或输入表达式以将日期设置为 ISO 格式的字符串或以毫秒为单位的时间戳。有关字符串格式的更多信息,请参阅 ISO 8601

¥Received After: Return only those emails received after the specified date and time. Use the date picker to select the day and time or enter an expression to set a date as a string in ISO format or a timestamp in milliseconds. Refer to ISO 8601 for more information on formatting the string.

  • 接收时间之前:仅返回指定日期和时间之前收到的电子邮件。使用日期选择器选择日期和时间,或输入表达式以将日期设置为 ISO 格式的字符串或以毫秒为单位的时间戳。有关字符串格式的更多信息,请参阅 ISO 8601

¥Received Before: Return only those emails received before the specified date and time. Use the date picker to select the day and time or enter an expression to set a date as a string in ISO format or a timestamp in milliseconds. Refer to ISO 8601 for more information on formatting the string.

  • 发件人:输入电子邮件地址或部分发件人名称,以仅返回来自该发件人的消息。

¥Sender: Enter an email or a part of a sender name to return messages from only that sender.

请参阅 Gmail API 方法:users.messages.list 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.list documentation for more information.

标记为已读#

¥Mark as Read

使用此操作将消息标记为已读。

¥Use this operation to mark a message as read.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择“标记为已读”。

¥Operation: Select Mark as Read.

  • 消息 ID:请输入要标记为已读的消息的 ID。

¥Message ID: Enter the ID of the message you wish to mark as read.

请参阅 Gmail API 方法:users.messages.modify 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.modify documentation for more information.

标记为未读#

¥Mark as Unread

使用此操作将消息标记为未读。

¥Use this operation to mark a message as unread.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择“标记为未读”。

¥Operation: Select Mark as Unread.

  • 消息 ID:请输入要标记为未读的消息的 ID。

¥Message ID: Enter the ID of the message you wish to mark as unread.

请参阅 Gmail API 方法:users.messages.modify 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.modify documentation for more information.

移除消息标签#

¥Remove Label from a message

使用此操作可从消息中移除一个或多个标签。

¥Use this operation to remove one or more labels from a message.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择“移除标签”。

¥Operation: Select Remove Label.

  • 消息 ID:请输入要移除标签的消息的 ID。

¥Message ID: Enter the ID of the message you want to remove the label from.

  • 标签名称或 ID:选择要移除的标签名称,或输入表达式以指定 ID。下拉列表将根据你选择的凭据自动填充。

¥Label Names or IDs: Select the Label names you want to remove or enter an expression to specify IDs. The dropdown populates based on the Credential you selected.

请参阅 Gmail API 方法:users.messages.modify 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.modify documentation for more information.

回复消息#

¥Reply to a message

使用此操作回复现有消息。

¥Use this operation to send a message as a reply to an existing message.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择“回复”。

¥Operation: Select Reply.

  • 消息 ID:请输入要回复的消息的 ID。

¥Message ID: Enter the ID of the message you want to reply to.

  • 选择电子邮件类型。选择文本或 HTML 格式。

¥Select the Email Type. Choose from Text or HTML.

  • 消息:输入邮件正文。

¥Message: Enter the email message body.

回复选项#

¥Reply options

使用这些选项来进一步细化节点的行为:

¥Use these options to further refine the node's behavior:

  • 附加到 n8n 归属:默认情况下,该节点会在电子邮件末尾附加语句 This email was sent automatically with n8n。要移除此语句,请关闭此选项。

¥Append n8n attribution: By default, the node appends the statement This email was sent automatically with n8n to the end of the email. To remove this statement, turn this option off.

  • 附件:选择添加附件以添加附件。输入附件字段名称(在“输入”中),以标识输入节点中的哪个字段包含附件。

¥Attachments: Select Add Attachment to add an attachment. Enter the Attachment Field Name (in Input) to identify which field from the input node contains the attachment.

  • 对于多个属性,请输入以逗号分隔的列表。

    ¥For multiple properties, enter a comma-separated list.

  • BCC:输入一个或多个密送收件人的电子邮件地址。用逗号分隔多个电子邮件地址,例如 jay@gatsby.com, jon@smith.com

¥BCC: Enter one or more email addresses for blind copy recipients. Separate multiple email addresses with a comma, for example jay@gatsby.com, jon@smith.com.

  • CC:输入一个或多个抄送收件人的电子邮件地址。用逗号分隔多个电子邮件地址,例如 jay@gatsby.com, jon@smith.com

¥CC: Enter one or more email addresses for carbon copy recipients. Separate multiple email addresses with a comma, for example jay@gatsby.com, jon@smith.com.

  • 发件人名称:输入你希望在收件人电子邮件中显示的发件人名称。

¥Sender Name: Enter the name you want displayed in your recipients' email as the sender.

  • 仅回复至发件人:选择是否回复所有人(已关闭)或仅回复发件人(已开启)。

¥Reply to Sender Only: Choose whether to reply all (turned off) or reply to the sender only (turned on).

请参阅 Gmail API 方法:users.messages.send 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.send documentation for more information.

发送消息#

¥Send a message

使用此操作发送消息。

¥Use this operation to send a message.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择“发送”。

¥Operation: Select Send.

  • 切换:请输入你希望接收邮件的电子邮件地址。

¥To: Enter the email address you want the email sent to.

  • 主题:输入主题。

¥Subject: Enter the subject line.

  • 选择电子邮件类型。选择文本或 HTML 格式。

¥Select the Email Type. Choose from Text or HTML.

  • 消息:输入邮件正文。

¥Message: Enter the email message body.

发送选项#

¥Send options

使用这些选项来进一步细化节点的行为:

¥Use these options to further refine the node's behavior:

  • 附加到 n8n 归属:默认情况下,该节点会在电子邮件末尾附加语句 This email was sent automatically with n8n。要移除此语句,请关闭此选项。

¥Append n8n attribution: By default, the node appends the statement This email was sent automatically with n8n to the end of the email. To remove this statement, turn this option off.

  • 附件:选择添加附件以添加附件。输入附件字段名称(在“输入”中),以标识输入节点中的哪个字段包含附件。

¥Attachments: Select Add Attachment to add an attachment. Enter the Attachment Field Name (in Input) to identify which field from the input node contains the attachment.

  • 对于多个属性,请输入以逗号分隔的列表。

    ¥For multiple properties, enter a comma-separated list.

  • BCC:输入一个或多个密送收件人的电子邮件地址。用逗号分隔多个电子邮件地址,例如 jay@gatsby.com, jon@smith.com

¥BCC: Enter one or more email addresses for blind copy recipients. Separate multiple email addresses with a comma, for example jay@gatsby.com, jon@smith.com.

  • CC:输入一个或多个抄送收件人的电子邮件地址。用逗号分隔多个电子邮件地址,例如 jay@gatsby.com, jon@smith.com

¥CC: Enter one or more email addresses for carbon copy recipients. Separate multiple email addresses with a comma, for example jay@gatsby.com, jon@smith.com.

  • 发件人名称:输入你希望在收件人电子邮件中显示的发件人名称。

¥Sender Name: Enter the name you want displayed in your recipients' email as the sender.

  • 发送回复至:输入要设置为回复地址的电子邮件地址。

¥Send Replies To: Enter an email address to set as the reply to address.

  • 仅回复至发件人:选择是否回复所有人(已关闭)或仅回复发件人(已开启)。

¥Reply to Sender Only: Choose whether to reply all (turned off) or reply to the sender only (turned on).

请参阅 Gmail API 方法:users.messages.send 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.send documentation for more information.

发送消息并等待批准#

¥Send a message and wait for approval

使用此操作发送消息,并在继续执行工作流之前等待收件人批准。

¥Use this operation to send a message and wait for approval from the recipient before continuing the workflow execution.

Use Wait for complex approvals

“发送并等待批准”操作非常适合简单的审批流程。对于更复杂的审批流程,请考虑使用 等待节点

¥The Send and Wait for Approval operation is well-suited for simple approval processes. For more complex approvals, consider using the Wait node.

请输入以下参数:

¥Enter these parameters:

  • 选择要连接的凭据或创建新凭据。

¥Select the Credential to connect with or create a new one.

  • 资源:选择“消息”。

¥Resource: Select Message.

  • 操作:选择“发送并等待批准”。

¥Operation: Select Send and Wait for Approval.

  • 切换:请输入你希望接收邮件的电子邮件地址。

¥To: Enter the email address you want the email sent to.

  • 主题:输入主题。

¥Subject: Enter the subject line.

  • 消息:输入邮件正文。

¥Message: Enter the email message body.

发送并等待批准选项#

¥Send and wait for approval options

使用这些选项来进一步细化节点的行为:

¥Use these options to further refine the node's behavior:

  • 审批类型:选择“仅批准”(默认)仅包含批准按钮,或选择“批准和拒绝”同时包含拒绝选项。

¥Type of Approval: Choose Approve Only (default) to include only an approval button or Approve and Disapprove to also include a disapproval option.

  • 审批按钮标签:批准按钮的标签(默认为“批准”)。

¥Approve Button Label: The label to use for the approval button (Approve by default).

  • 审批按钮样式:是否将批准按钮的样式设置为主按钮(默认)或辅助按钮。

¥Approve Button Style: Whether to style the approval button as a Primary (default) or Secondary button.

  • 拒绝按钮标签:拒绝按钮的标签(默认为“拒绝”)。仅当你将“审批类型”设置为“批准”和“不批准”时可见。

¥Disapprove Button Label: The label to use for the disapproval button (Decline by default). Only visible when you set Type of Approval to Approve and Disapprove.

  • 拒绝按钮样式:是否将“不赞成”按钮的样式设置为主要按钮或次要按钮(默认)。仅当你将“审批类型”设置为“批准”和“不批准”时可见。

¥Disapprove Button Style: Whether to style the disapproval button as a Primary or Secondary (default) button. Only visible when you set Type of Approval to Approve and Disapprove.

请参阅 Gmail API 方法:users.messages.send 文档,了解更多信息。

¥Refer to the Gmail API Method: users.messages.send documentation for more information.

常见问题#

¥Common issues

有关常见错误或问题以及建议的解决方法,请参阅 常见问题

¥For common errors or issues and suggested resolution steps, refer to Common Issues.