Email (SendGrid)
SendGrid events provider 支持通过 SendGrid API 发送事务型邮件。
{ "events-email-sendgrid": { "enabled": true, "api_key": "SG.xxx...", "from_email": "noreply@example.com", "from_name": "My App" }}| 选项 | 必需 | 描述 |
|---|---|---|
enabled | 是 | 启用/禁用 provider |
api_key | 是 | SendGrid API key |
from_email | 是 | 默认发件人邮箱 |
from_name | 否 | 默认发件人名称 |
- id: send_email type: event config: provider: events-email-sendgrid action: send to: "user@example.com" subject: "Welcome!" content: "Thank you for signing up."HTML 邮件
Section titled “HTML 邮件”- id: send_html type: event config: provider: events-email-sendgrid action: send to: "user@example.com" subject: "Your Order Confirmation" html: | <h1>Order Confirmed!</h1> <p>Order #{{order_id}} has been confirmed.</p>- id: send_template type: event config: provider: events-email-sendgrid action: send_template to: "user@example.com" template_id: "d-abc123..." dynamic_data: name: "{{user_name}}" order_id: "{{order_id}}"- id: send_with_attachment type: event config: provider: events-email-sendgrid action: send to: "user@example.com" subject: "Your Invoice" content: "Please find your invoice attached." attachments: - filename: "invoice.pdf" content: "{{base64_content}}" type: "application/pdf"