-
Notifications
You must be signed in to change notification settings - Fork 3
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 #33 from kenzo0107/support_template_and_template_v…
…ersion Support template and template version
- Loading branch information
Showing
31 changed files
with
1,478 additions
and
32 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "sendgrid_template Data Source - terraform-provider-sendgrid" | ||
subcategory: "" | ||
description: |- | ||
Provides template resource. | ||
An HTML template that can establish a consistent design for transactional emails https://sendgrid.com/use-cases/transactional-email/. | ||
Each parent account, as well as each Subuser, can create up to 300 different transactional templates. Templates are specific to the parent account or Subuser, meaning templates created on a parent account will not be accessible from the parent's Subuser accounts. | ||
Transactional templates are templates created specifically for transactional email and are not to be confused with Marketing Campaigns designs https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/. For more information about transactional templates, please see our Dynamic Transactional Templates documentation https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/. | ||
--- | ||
|
||
# sendgrid_template (Data Source) | ||
|
||
Provides template resource. | ||
|
||
An HTML template that can establish a consistent design for [transactional emails](https://sendgrid.com/use-cases/transactional-email/). | ||
|
||
Each parent account, as well as each Subuser, can create up to 300 different transactional templates. Templates are specific to the parent account or Subuser, meaning templates created on a parent account will not be accessible from the parent's Subuser accounts. | ||
|
||
Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns designs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/). For more information about transactional templates, please see our [Dynamic Transactional Templates documentation](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "sendgrid_template" "example" { | ||
id = "d-1234567890abcdefghijklmnopqrstuv" | ||
} | ||
output "name" { | ||
value = data.sendgrid_template.example.name | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `id` (String) The ID of the transactional template. | ||
|
||
### Read-Only | ||
|
||
- `generation` (String) Defines the generation of the template. | ||
- `name` (String) The name for the transactional template. |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "sendgrid_template_version Data Source - terraform-provider-sendgrid" | ||
subcategory: "" | ||
description: |- | ||
Provides a template version resource. | ||
Represents the code for a particular transactional template. Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. | ||
For more information about transactional templates, please see our Transactional Templates documentation. You can also manage your Transactional Templates in the Dynamic Templates section of the Twilio SendGrid App. | ||
--- | ||
|
||
# sendgrid_template_version (Data Source) | ||
|
||
Provides a template version resource. | ||
|
||
Represents the code for a particular transactional template. Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. | ||
|
||
For more information about transactional templates, please see our Transactional Templates documentation. You can also manage your Transactional Templates in the Dynamic Templates section of the Twilio SendGrid App. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "sendgrid_template_version" "example" { | ||
template_id = "d-1234567890abcdefghijklmnopqrstuv" | ||
id = "abcde123-fg45-6789-012e-3456789abcde" | ||
} | ||
output "name" { | ||
value = data.sendgrid_template_version.example.name | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `id` (String) The ID of the transactional template version. | ||
- `template_id` (String) The ID of the transactional template. | ||
|
||
### Read-Only | ||
|
||
- `active` (Number) Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active. Allowed Values: 0, 1 | ||
- `editor` (String) The editor used in the UI. | ||
- `generate_plain_content` (Boolean) If true, plain_content is always generated from html_content. If false, plain_content is not altered. | ||
- `html_content` (String) The HTML content of the version. Maximum of 1048576 bytes allowed. | ||
- `name` (String) The name for the transactional template. | ||
- `plain_content` (String) Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed. | ||
- `subject` (String) Subject of the new transactional template version. maxLength: 255 | ||
- `test_data` (String) For dynamic templates only, the mock json data that will be used for template preview and test sends. | ||
- `thumbnail_url` (String) A Thumbnail preview of the template's html content. |
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
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "sendgrid_template Resource - terraform-provider-sendgrid" | ||
subcategory: "" | ||
description: |- | ||
Provides template resource. | ||
An HTML template that can establish a consistent design for transactional emails https://sendgrid.com/use-cases/transactional-email/. | ||
Each parent account, as well as each Subuser, can create up to 300 different transactional templates. Templates are specific to the parent account or Subuser, meaning templates created on a parent account will not be accessible from the parent's Subuser accounts. | ||
Transactional templates are templates created specifically for transactional email and are not to be confused with Marketing Campaigns designs https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/. For more information about transactional templates, please see our Dynamic Transactional Templates documentation https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/. | ||
--- | ||
|
||
# sendgrid_template (Resource) | ||
|
||
Provides template resource. | ||
|
||
An HTML template that can establish a consistent design for [transactional emails](https://sendgrid.com/use-cases/transactional-email/). | ||
|
||
Each parent account, as well as each Subuser, can create up to 300 different transactional templates. Templates are specific to the parent account or Subuser, meaning templates created on a parent account will not be accessible from the parent's Subuser accounts. | ||
|
||
Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns designs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/). For more information about transactional templates, please see our [Dynamic Transactional Templates documentation](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "sendgrid_template" "example" { | ||
name = "dummy" | ||
generation = "dynamic" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) The name for the transactional template. maxLength: 100 | ||
|
||
### Optional | ||
|
||
- `generation` (String) Defines the generation of the template. Allowed Values: `legacy`, `dynamic` | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of the transactional template. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
% terraform import sendgrid_template.example <template id> | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "sendgrid_template_version Resource - terraform-provider-sendgrid" | ||
subcategory: "" | ||
description: |- | ||
Provides a template version resource. | ||
Represents the code for a particular transactional template. Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. | ||
For more information about transactional templates, please see our Transactional Templates documentation. You can also manage your Transactional Templates in the Dynamic Templates section of the Twilio SendGrid App. | ||
--- | ||
|
||
# sendgrid_template_version (Resource) | ||
|
||
Provides a template version resource. | ||
|
||
Represents the code for a particular transactional template. Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. | ||
|
||
For more information about transactional templates, please see our Transactional Templates documentation. You can also manage your Transactional Templates in the Dynamic Templates section of the Twilio SendGrid App. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "sendgrid_template" "example" { | ||
name = "dummy" | ||
generation = "dynamic" | ||
} | ||
resource "sendgrid_template_version" "example" { | ||
template_id = sendgrid_template.example.id | ||
name = "dummy" | ||
active = 1 | ||
test_data = jsonencode({ | ||
"name" : "dummy" | ||
}) | ||
html_content = "<%body%>" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) The name for the transactional template. | ||
- `template_id` (String) The ID of the transactional template. | ||
|
||
### Optional | ||
|
||
- `active` (Number) Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active. Allowed Values: 0, 1 | ||
- `editor` (String) The editor used in the UI. | ||
- `generate_plain_content` (Boolean) If true, plain_content is always generated from html_content. If false, plain_content is not altered. | ||
- `html_content` (String) The HTML content of the version. Maximum of 1048576 bytes allowed. | ||
- `plain_content` (String) Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed. | ||
- `subject` (String) Subject of the new transactional template version. maxLength: 255 | ||
- `test_data` (String) For dynamic templates only, the mock json data that will be used for template preview and test sends. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of the transactional template version. | ||
- `thumbnail_url` (String) A Thumbnail preview of the template's html content. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
% terraform import sendgrid_template_version.example <template id>/<template version id> | ||
``` |
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
data "sendgrid_template" "example" { | ||
id = "d-1234567890abcdefghijklmnopqrstuv" | ||
} | ||
|
||
output "name" { | ||
value = data.sendgrid_template.example.name | ||
} |
9 changes: 9 additions & 0 deletions
9
examples/data-sources/sendgrid_template_version/data-source.tf
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
data "sendgrid_template_version" "example" { | ||
template_id = "d-1234567890abcdefghijklmnopqrstuv" | ||
id = "abcde123-fg45-6789-012e-3456789abcde" | ||
} | ||
|
||
output "name" { | ||
value = data.sendgrid_template_version.example.name | ||
} |
7 changes: 7 additions & 0 deletions
7
examples/data-sources/sendgrid_unsubscribe_group/data-source.tf
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
data "sendgrid_unsubscribe_group" "example" { | ||
id = "13253" | ||
} | ||
|
||
output "name" { | ||
value = data.sendgrid_unsubscribe_group.example.name | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
% terraform import sendgrid_template.example <template id> |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
resource "sendgrid_template" "example" { | ||
name = "dummy" | ||
generation = "dynamic" | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
% terraform import sendgrid_template_version.example <template id>/<template version id> |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resource "sendgrid_template" "example" { | ||
name = "dummy" | ||
generation = "dynamic" | ||
} | ||
|
||
resource "sendgrid_template_version" "example" { | ||
template_id = sendgrid_template.example.id | ||
name = "dummy" | ||
active = 1 | ||
test_data = jsonencode({ | ||
"name" : "dummy" | ||
}) | ||
html_content = "<%body%>" | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
% terraform import sendgrid_unsubscribe_group.example <unsubscribe group id> |
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
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
Oops, something went wrong.