跳转到内容

Email

Email messaging provider 让你的数字员工可以通过邮件进行通信。它支持:

  • 发送邮件
  • 接收邮件(通过 webhook)
  • HTML 格式
  • 附件
  1. 配置 SMTP 设置

    answers.json
    {
    "messaging-email": {
    "enabled": true,
    "smtp_host": "smtp.example.com",
    "smtp_port": 587,
    "smtp_user": "your-email@example.com",
    "smtp_password": "your-password",
    "from_address": "support@example.com",
    "from_name": "Support Bot"
    }
    }
  2. 配置入站邮件(可选)

    若要接收邮件,请通过你的邮件 provider 设置 webhook:

    • SendGrid Inbound Parse
    • Mailgun Routes
    • AWS SES
  3. 运行设置

    Terminal window
    gtc setup --answers answers.json ./my-bundle
选项必填说明
enabled启用/禁用 provider
smtp_hostSMTP 服务器主机名
smtp_portSMTP 端口(通常为 587 或 465)
smtp_userSMTP 用户名
smtp_passwordSMTP 密码
from_address默认发件地址
from_name发件地址的显示名称
webhook_url入站 webhook 端点
- id: send_email
type: reply
config:
to: "{{user_email}}"
subject: "Your Support Request"
message: "Thank you for contacting us. We'll get back to you shortly."
- id: send_html_email
type: reply
config:
to: "{{user_email}}"
subject: "Welcome!"
html: |
<html>
<body>
<h1>Welcome to Our Service!</h1>
<p>Thank you for signing up.</p>
<a href="https://example.com/start">Get Started</a>
</body>
</html>
- id: send_with_attachment
type: reply
config:
to: "{{user_email}}"
subject: "Your Report"
message: "Please find your report attached."
attachments:
- url: "https://example.com/report.pdf"
filename: "report.pdf"
- id: send_copy
type: reply
config:
to: "{{user_email}}"
cc: "manager@example.com"
bcc: "archive@example.com"
subject: "Support Update"
message: "Your ticket has been resolved."
flows/on_email.ygtc
name: handle_email
version: "1.0"
nodes:
- id: process
type: reply
config:
to: "{{from_address}}"
subject: "Re: {{subject}}"
message: "Thank you for your email. We've received your message."
triggers:
- type: email
target: process