All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| TemplatesByNameDelete | Delete /templates/{name} | Delete Template |
| TemplatesByNameGet | Get /templates/{name} | Load Template |
| TemplatesByNamePut | Put /templates/{name} | Update Template |
| TemplatesGet | Get /templates | Load Templates |
| TemplatesPost | Post /templates | Add Template |
TemplatesByNameDelete(ctx, name).Execute()
Delete Template
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "Template01" // string | Name of template.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.TemplatesAPI.TemplatesByNameDelete(context.Background(), name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.TemplatesByNameDelete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of template. |
Other parameters are passed through a pointer to a apiTemplatesByNameDeleteRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Template TemplatesByNameGet(ctx, name).Execute()
Load Template
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "Template01" // string | Name of template.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TemplatesAPI.TemplatesByNameGet(context.Background(), name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.TemplatesByNameGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TemplatesByNameGet`: Template
fmt.Fprintf(os.Stdout, "Response from `TemplatesAPI.TemplatesByNameGet`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of template. |
Other parameters are passed through a pointer to a apiTemplatesByNameGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Template TemplatesByNamePut(ctx, name).TemplatePayload(templatePayload).Execute()
Update Template
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
name := "Template01" // string | Name of template.
templatePayload := *openapiclient.NewTemplatePayload("Name_example") // TemplatePayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TemplatesAPI.TemplatesByNamePut(context.Background(), name).TemplatePayload(templatePayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.TemplatesByNamePut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TemplatesByNamePut`: Template
fmt.Fprintf(os.Stdout, "Response from `TemplatesAPI.TemplatesByNamePut`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| name | string | Name of template. |
Other parameters are passed through a pointer to a apiTemplatesByNamePutRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
templatePayload | TemplatePayload | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]Template TemplatesGet(ctx).ScopeType(scopeType).TemplateTypes(templateTypes).Limit(limit).Offset(offset).Execute()
Load Templates
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
scopeType := []openapiclient.TemplateScope{openapiclient.TemplateScope("Personal")} // []TemplateScope | Return templates with specified scope only
templateTypes := []openapiclient.TemplateType{openapiclient.TemplateType("RawHTML")} // []TemplateType | Return templates with specified type only (optional)
limit := int32(100) // int32 | Maximum number of returned items. (optional)
offset := int32(20) // int32 | How many items should be returned ahead. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TemplatesAPI.TemplatesGet(context.Background()).ScopeType(scopeType).TemplateTypes(templateTypes).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.TemplatesGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TemplatesGet`: []Template
fmt.Fprintf(os.Stdout, "Response from `TemplatesAPI.TemplatesGet`: %v\n", resp)
}Other parameters are passed through a pointer to a apiTemplatesGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| scopeType | []TemplateScope | Return templates with specified scope only | |
| templateTypes | []TemplateType | Return templates with specified type only | |
| limit | int32 | Maximum number of returned items. | |
| offset | int32 | How many items should be returned ahead. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Template TemplatesPost(ctx).TemplatePayload(templatePayload).Execute()
Add Template
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/elasticemail/elasticemail-go"
)
func main() {
templatePayload := *openapiclient.NewTemplatePayload("Name_example") // TemplatePayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TemplatesAPI.TemplatesPost(context.Background()).TemplatePayload(templatePayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.TemplatesPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TemplatesPost`: Template
fmt.Fprintf(os.Stdout, "Response from `TemplatesAPI.TemplatesPost`: %v\n", resp)
}Other parameters are passed through a pointer to a apiTemplatesPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| templatePayload | TemplatePayload |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]