Postmark binding spec

Detailed documentation on the Postmark binding component

Component format

To setup Postmark binding create a component of type bindings.postmark. See this guide on how to create and apply a binding configuration.

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

Warning

The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described here.

Spec metadata fields

FieldRequiredBinding supportDetailsExample
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.

Binding support

This component supports output binding with the following operations:

  • 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. }

Last modified July 27, 2022: Remove namespace element from component examples (#2647) (ff9de5c8)