Skip to content

Commit

Permalink
Merge pull request #3422 from yannart/sendgrid-dynamic-template
Browse files Browse the repository at this point in the history
Add dynamic template support to Twilio Sendgrid binding
  • Loading branch information
hhunter-ms authored Jun 21, 2023
2 parents dd379f5 + 8715f0c commit 942d9cc
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ spec:
value: "[email protected]" # optional
- name: emailBcc
value: "[email protected]" # optional
- name: dynamicTemplateId
value: "d-123456789" # optional
- name: dynamicTemplateData
value: '{"customer":{"name":"John Smith"}}' # optional
- name: apiKey
value: "YOUR_API_KEY" # required, this is your SendGrid key
```
Expand All @@ -55,7 +59,8 @@ The above example uses secrets as plain strings. It is recommended to use a secr
| emailCc | N | Output | If set this specifies the 'cc' email address of the email message. Only a single email address is allowed. Optional field, see [below](#example-request-payload) | `"[email protected]"` |
| emailBcc | N | Output | If set this specifies the 'bcc' email address of the email message. Only a single email address is allowed. Optional field, see [below](#example-request-payload) | `"[email protected]"` |
| subject | N | Output | If set this specifies the subject of the email message. Optional field, see [below](#example-request-payload) | `"subject of the email"` |
| dynamicTemplateId | N | Output | If set this specifies the dynamic template id. Optional field, see [below](#example-request-payload) | `"d-123456789"` |
| dynamicTemplateData | N | Output | If set this specifies the dynamic template data. Optional field, see [below](#example-request-payload) | `'{"customer":{"name":"John Smith"}}'` |
## Binding support
Expand All @@ -78,6 +83,21 @@ You can specify any of the optional metadata properties on the output binding re
}
```

## Dynamic templates
If a dynamic template is used, a `dynamicTemplateId` needs to be provided and then the `dynamicTemplateData` is used:

```json
{
"operation": "create",
"metadata": {
"emailTo": "[email protected]",
"subject": "An template email from Dapr SendGrid binding",
"dynamicTemplateId": "d-123456789",
"dynamicTemplateData": "{\"customer\":{\"name\":\"John Smith\"}}"
}
}
```

## Related links

- [Basic schema for a Dapr component]({{< ref component-schema >}})
Expand Down

0 comments on commit 942d9cc

Please sign in to comment.