|
| 1 | +# ReachTemplatesApi |
| 2 | + |
| 3 | +All URIs are relative to *https://developers.hostinger.com* |
| 4 | + |
| 5 | +|Method | HTTP request | Description| |
| 6 | +|------------- | ------------- | -------------| |
| 7 | +|[**createAnEmailTemplateV1**](#createanemailtemplatev1) | **POST** /api/reach/v1/profiles/{profileUuid}/templates | Create an email template| |
| 8 | +|[**listEmailTemplatesV1**](#listemailtemplatesv1) | **GET** /api/reach/v1/profiles/{profileUuid}/templates | List email templates| |
| 9 | + |
| 10 | +# **createAnEmailTemplateV1** |
| 11 | +> ReachV1TemplatesTemplateResource createAnEmailTemplateV1(reachV1TemplatesStoreRequest) |
| 12 | +
|
| 13 | +Create an email template in a profile. The template holds the HTML body a campaign reuses, so it can be created before any campaign exists. Only the template metadata comes back - keep the returned `uuid` to reference it as the `template_uuid` of a campaign. |
| 14 | + |
| 15 | +### Example |
| 16 | + |
| 17 | +```typescript |
| 18 | +import { |
| 19 | + ReachTemplatesApi, |
| 20 | + Configuration, |
| 21 | + ReachV1TemplatesStoreRequest |
| 22 | +} from '@hostinger/sdk'; |
| 23 | + |
| 24 | +const configuration = new Configuration(); |
| 25 | +const apiInstance = new ReachTemplatesApi(configuration); |
| 26 | + |
| 27 | +let profileUuid: string; //Profile uuid parameter (default to undefined) |
| 28 | +let reachV1TemplatesStoreRequest: ReachV1TemplatesStoreRequest; // |
| 29 | + |
| 30 | +const { status, data } = await apiInstance.createAnEmailTemplateV1( |
| 31 | + profileUuid, |
| 32 | + reachV1TemplatesStoreRequest |
| 33 | +); |
| 34 | +``` |
| 35 | + |
| 36 | +### Parameters |
| 37 | + |
| 38 | +|Name | Type | Description | Notes| |
| 39 | +|------------- | ------------- | ------------- | -------------| |
| 40 | +| **reachV1TemplatesStoreRequest** | **ReachV1TemplatesStoreRequest**| | | |
| 41 | +| **profileUuid** | [**string**] | Profile uuid parameter | defaults to undefined| |
| 42 | + |
| 43 | + |
| 44 | +### Return type |
| 45 | + |
| 46 | +**ReachV1TemplatesTemplateResource** |
| 47 | + |
| 48 | +### Authorization |
| 49 | + |
| 50 | +[apiToken](../README.md#apiToken) |
| 51 | + |
| 52 | +### HTTP request headers |
| 53 | + |
| 54 | + - **Content-Type**: application/json |
| 55 | + - **Accept**: application/json |
| 56 | + |
| 57 | + |
| 58 | +### HTTP response details |
| 59 | +| Status code | Description | Response headers | |
| 60 | +|-------------|-------------|------------------| |
| 61 | +|**200** | Success response | - | |
| 62 | +|**422** | Validation error response | - | |
| 63 | +|**401** | Unauthenticated response | - | |
| 64 | +|**500** | Error response | - | |
| 65 | + |
| 66 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 67 | + |
| 68 | +# **listEmailTemplatesV1** |
| 69 | +> Array<ReachV1TemplatesTemplateResource> listEmailTemplatesV1() |
| 70 | +
|
| 71 | +Get a list of the email templates in a profile, most recently updated first. Templates are the reusable email bodies a campaign is built from. The list is not paginated and only the metadata is returned - the template content itself is not exposed. Use the `uuid` of a template as the `template_uuid` when creating a campaign. |
| 72 | + |
| 73 | +### Example |
| 74 | + |
| 75 | +```typescript |
| 76 | +import { |
| 77 | + ReachTemplatesApi, |
| 78 | + Configuration |
| 79 | +} from '@hostinger/sdk'; |
| 80 | + |
| 81 | +const configuration = new Configuration(); |
| 82 | +const apiInstance = new ReachTemplatesApi(configuration); |
| 83 | + |
| 84 | +let profileUuid: string; //Profile uuid parameter (default to undefined) |
| 85 | + |
| 86 | +const { status, data } = await apiInstance.listEmailTemplatesV1( |
| 87 | + profileUuid |
| 88 | +); |
| 89 | +``` |
| 90 | + |
| 91 | +### Parameters |
| 92 | + |
| 93 | +|Name | Type | Description | Notes| |
| 94 | +|------------- | ------------- | ------------- | -------------| |
| 95 | +| **profileUuid** | [**string**] | Profile uuid parameter | defaults to undefined| |
| 96 | + |
| 97 | + |
| 98 | +### Return type |
| 99 | + |
| 100 | +**Array<ReachV1TemplatesTemplateResource>** |
| 101 | + |
| 102 | +### Authorization |
| 103 | + |
| 104 | +[apiToken](../README.md#apiToken) |
| 105 | + |
| 106 | +### HTTP request headers |
| 107 | + |
| 108 | + - **Content-Type**: Not defined |
| 109 | + - **Accept**: application/json |
| 110 | + |
| 111 | + |
| 112 | +### HTTP response details |
| 113 | +| Status code | Description | Response headers | |
| 114 | +|-------------|-------------|------------------| |
| 115 | +|**200** | Success response | - | |
| 116 | +|**401** | Unauthenticated response | - | |
| 117 | +|**500** | Error response | - | |
| 118 | + |
| 119 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 120 | + |
0 commit comments