Postmark binding spec

Detailed documentation on the Postmark binding component

配置

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

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: postmark
  5. namespace: default
  6. spec:
  7. type: bindings.postmark
  8. metadata:
  9. - name: accountToken
  10. value: "YOUR_ACCOUNT_TOKEN" # required, this is your Postmark account token
  11. - name: serverToken
  12. value: "YOUR_SERVER_TOKEN" # required, this is your Postmark server token
  13. - name: emailFrom
  14. value: "testapp@dapr.io" # optional
  15. - name: emailTo
  16. value: "dave@dapr.io" # optional
  17. - name: subject
  18. value: "Hello!" # optional # optional # optional

Warning

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

元数据字段规范

字段必填绑定支持详情示例
accountTokenYOutputThe Postmark account token, this should be considered a secret value“account token”
serverTokenYOutputThe Postmark server token, this should be considered a secret value“server token”
emailFromNOutputIf set this specifies the ‘from’ email address of the email message“me@exmaple.com”
emailToNOutputIf set this specifies the ‘to’ email address of the email message“me@example.com”
emailCcNOutputIf set this specifies the ‘cc’ email address of the email message“me@example.com”
emailBccNOutputIf set this specifies the ‘bcc’ email address of the email message“me@example.com”
subjectNOutputIf set this specifies the subject of the email message“me@example.com”

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

Combined, the optional metadata properties in the component configuration and the request payload should at least contain the emailFrom, emailTo and subject fields, as these are required to send an email with success.

绑定支持

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

  • create

Example request payload

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

相关链接