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
. See this guide on how to create and apply a binding configuration.
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: sendgrid
namespace: default
spec:
type: bindings.twilio.sendgrid
version: v1
metadata:
- name: emailFrom
value: "testapp@dapr.io" # optional
- name: emailTo
value: "dave@dapr.io" # optional
- name: subject
value: "Hello!" # optional
- name: apiKey
value: "YOUR_API_KEY" # required, this is your SendGrid key
Warning
以上示例将密钥明文存储, It is recommended to use a secret store for the secrets as described here.
元数据字段规范
字段 | 必填 | 绑定支持 | 详情 | Example |
---|---|---|---|---|
apiKey | Y | 输出 | SendGrid API key, this should be considered a secret value | “apikey” |
emailFrom | N | 输出 | If set this specifies the ‘from’ email address of the email message. Optional field, see below | “me@example.com” |
emailTo | N | 输出 | If set this specifies the ‘to’ email address of the email message. Optional field, see below | “me@example.com” |
emailCc | N | 输出 | If set this specifies the ‘cc’ email address of the email message. Optional field, see below | “me@example.com” |
emailBcc | N | 输出 | If set this specifies the ‘bcc’ email address of the email message. Optional field, see below | “me@example.com” |
subject | N | 输出 | If set this specifies the subject of the email message. Optional field, see below | “subject of the email” |
绑定支持
字段名为 ttlInSeconds
。
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.)
{
"metadata": {
"emailTo": "changeme@example.net",
"subject": "An email from Dapr SendGrid binding"
},
"data": "<h1>Testing Dapr Bindings</h1>This is a test.<br>Bye!"
}