Twilio SendGrid binding spec

Detailed documentation on the Twilio SendGrid binding component

配置

To setup Twilio SendGrid binding create a component of type bindings.twilio.sendgrid. 请参阅本指南,了解如何创建和应用绑定配置。

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: sendgrid
  5. namespace: default
  6. spec:
  7. type: bindings.twilio.sendgrid
  8. version: v1
  9. metadata:
  10. - name: emailFrom
  11. value: "testapp@dapr.io" # optional
  12. - name: emailTo
  13. value: "dave@dapr.io" # optional
  14. - name: subject
  15. value: "Hello!" # optional
  16. - name: apiKey
  17. value: "YOUR_API_KEY" # required, this is your SendGrid key # optional
  18. - name: apiKey
  19. value: "YOUR_API_KEY" # required, this is your SendGrid key # optional
  20. - name: apiKey
  21. value: "YOUR_API_KEY" # required, this is your SendGrid key

Warning

以上示例将 Secret 明文存储。 更推荐的方式是使用 Secret 组件, 这里

元数据字段规范

字段必填绑定支持详情示例
apiKeyYOutputSendGrid API key, this should be considered a secret value“apikey”
emailFromNOutputIf set this specifies the ‘from’ email address of the email message. Optional field, see below“me@example.com”
emailToNOutputIf set this specifies the ‘to’ email address of the email message. Optional field, see below“me@example.com”
emailCcNOutputIf set this specifies the ‘cc’ email address of the email message. Optional field, see below“me@example.com”
emailBccNOutputIf set this specifies the ‘bcc’ email address of the email message. Optional field, see below“me@example.com”
subjectNOutputIf set this specifies the subject of the email message. Optional field, see below“subject of the email”

绑定支持

该组件支持输出绑定,其操作如下:

  • create

Example request payload

You can specify any of the optional metadata properties on the output binding request too (e.g. emailFrom, emailTo, subject, etc.)

  1. {
  2. "metadata": {
  3. "emailTo": "changeme@example.net",
  4. "subject": "An email from Dapr SendGrid binding"
  5. },
  6. "data": "<h1>Testing Dapr Bindings</h1>This is a test.<br>Bye!"
  7. }
  8. }
  9. }
  10. }

相关链接