-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3422 from yannart/sendgrid-dynamic-template
Add dynamic template support to Twilio Sendgrid binding
- Loading branch information
Showing
1 changed file
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
``` | ||
|
@@ -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 | ||
|
@@ -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 >}}) | ||
|