Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions template_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import (
)

type OutputGetTemplateVersion struct {
ID string `json:"id,omitempty"`
TemplateID string `json:"template_id,omitempty"`
Active int `json:"active,omitempty"`
Name string `json:"name,omitempty"`
HTMLContent string `json:"html_content,omitempty"`
PlainContent string `json:"plain_content,omitempty"`
GeneratePlainContent bool `json:"generate_plain_content,omitempty"`
Subject string `json:"subject,omitempty"`
Editor string `json:"editor,omitempty"`
TestData string `json:"test_data,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
Warnings Warning `json:"warnings,omitempty"`
ThumbnailURL string `json:"thumbnail_url,omitempty"`
ID string `json:"id,omitempty"`
TemplateID string `json:"template_id,omitempty"`
Active int `json:"active,omitempty"`
Name string `json:"name,omitempty"`
HTMLContent string `json:"html_content,omitempty"`
PlainContent string `json:"plain_content,omitempty"`
GeneratePlainContent bool `json:"generate_plain_content,omitempty"`
Subject string `json:"subject,omitempty"`
Editor string `json:"editor,omitempty"`
TestData string `json:"test_data,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
Warnings []Warning `json:"warnings,omitempty"`
ThumbnailURL string `json:"thumbnail_url,omitempty"`
}

// see: https://docs.sendgrid.com/api-reference/transactional-templates-versions/retrieve-a-specific-transactional-template-version
Expand Down
10 changes: 9 additions & 1 deletion template_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ func TestGetTemplateVersion(t *testing.T) {
"name": "dummy",
"generate_plain_content": true,
"updated_at": "2024-01-20 08:46:07",
"editor": "code"
"editor": "code",
"warnings": [
{
"message": "Failed to validate handlebars"
}
]
}`); err != nil {
t.Fatal(err)
}
Expand All @@ -43,6 +48,9 @@ func TestGetTemplateVersion(t *testing.T) {
GeneratePlainContent: true,
UpdatedAt: "2024-01-20 08:46:07",
Editor: "code",
Warnings: []Warning{
{Message: "Failed to validate handlebars"},
},
}
if !reflect.DeepEqual(want, expected) {
t.Fatal(ErrIncorrectResponse, errors.New(pretty.Compare(want, expected)))
Expand Down
Loading