zyphr 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +47 -6
- data/docs/AuthEmailTemplate.md +42 -0
- data/docs/AuthEmailTemplateDefault.md +26 -0
- data/docs/AuthEmailTemplateDefaultResponse.md +20 -0
- data/docs/AuthEmailTemplateDeleteResponse.md +20 -0
- data/docs/{SuccessResultData.md → AuthEmailTemplateDeleteResponseData.md} +2 -2
- data/docs/AuthEmailTemplateListResponse.md +20 -0
- data/docs/AuthEmailTemplatePreviewDraft.md +28 -0
- data/docs/AuthEmailTemplatePreviewRequest.md +20 -0
- data/docs/AuthEmailTemplatePreviewResponse.md +20 -0
- data/docs/AuthEmailTemplatePreviewResult.md +26 -0
- data/docs/AuthEmailTemplateResponse.md +20 -0
- data/docs/AuthEmailTemplateTestRequest.md +20 -0
- data/docs/AuthEmailTemplateTestResponse.md +20 -0
- data/docs/AuthEmailTemplateTestResult.md +20 -0
- data/docs/AuthEmailTemplateVersion.md +38 -0
- data/docs/AuthEmailTemplateVersionsResponse.md +20 -0
- data/docs/AuthEmailTemplatesApi.md +782 -0
- data/docs/AuthEmailType.md +15 -0
- data/docs/BulkUpsertAuthEmailTemplatesRequest.md +22 -0
- data/docs/BulkUpsertAuthEmailTemplatesResponse.md +20 -0
- data/docs/ResubscribeResponse.md +1 -1
- data/docs/SendSlackMessageRequest.md +40 -0
- data/docs/SendSlackMessageResponse.md +20 -0
- data/docs/SendSlackMessageResult.md +28 -0
- data/docs/SlackApi.md +233 -0
- data/docs/SlackMessage.md +50 -0
- data/docs/SlackMessageListResponse.md +20 -0
- data/docs/SlackMessageListResponseMeta.md +24 -0
- data/docs/SlackMessageResponse.md +20 -0
- data/docs/SlackMessageStatus.md +15 -0
- data/docs/SlackMessageSummary.md +38 -0
- data/docs/SuccessResult.md +1 -1
- data/docs/UpsertAuthEmailTemplateRequest.md +34 -0
- data/lib/zyphr/api/auth_email_templates_api.rb +688 -0
- data/lib/zyphr/api/slack_api.rb +233 -0
- data/lib/zyphr/models/auth_email_template.rb +372 -0
- data/lib/zyphr/models/auth_email_template_default.rb +281 -0
- data/lib/zyphr/models/auth_email_template_default_response.rb +229 -0
- data/lib/zyphr/models/auth_email_template_delete_response.rb +229 -0
- data/lib/zyphr/models/{success_result_data.rb → auth_email_template_delete_response_data.rb} +3 -3
- data/lib/zyphr/models/auth_email_template_list_response.rb +231 -0
- data/lib/zyphr/models/auth_email_template_preview_draft.rb +272 -0
- data/lib/zyphr/models/auth_email_template_preview_request.rb +232 -0
- data/lib/zyphr/models/auth_email_template_preview_response.rb +229 -0
- data/lib/zyphr/models/auth_email_template_preview_result.rb +258 -0
- data/lib/zyphr/models/auth_email_template_response.rb +229 -0
- data/lib/zyphr/models/auth_email_template_test_request.rb +249 -0
- data/lib/zyphr/models/auth_email_template_test_response.rb +229 -0
- data/lib/zyphr/models/auth_email_template_test_result.rb +229 -0
- data/lib/zyphr/models/auth_email_template_version.rb +352 -0
- data/lib/zyphr/models/auth_email_template_versions_response.rb +231 -0
- data/lib/zyphr/models/auth_email_type.rb +41 -0
- data/lib/zyphr/models/bulk_upsert_auth_email_templates_request.rb +239 -0
- data/lib/zyphr/models/bulk_upsert_auth_email_templates_response.rb +231 -0
- data/lib/zyphr/models/resubscribe_response.rb +1 -1
- data/lib/zyphr/models/send_slack_message_request.rb +340 -0
- data/lib/zyphr/models/send_slack_message_response.rb +229 -0
- data/lib/zyphr/models/send_slack_message_result.rb +289 -0
- data/lib/zyphr/models/slack_message.rb +406 -0
- data/lib/zyphr/models/slack_message_list_response.rb +231 -0
- data/lib/zyphr/models/slack_message_list_response_meta.rb +254 -0
- data/lib/zyphr/models/slack_message_response.rb +229 -0
- data/lib/zyphr/models/slack_message_status.rb +43 -0
- data/lib/zyphr/models/slack_message_summary.rb +340 -0
- data/lib/zyphr/models/success_result.rb +1 -1
- data/lib/zyphr/models/upsert_auth_email_template_request.rb +335 -0
- data/lib/zyphr.rb +31 -1
- data/spec/api/auth_email_templates_api_spec.rb +157 -0
- data/spec/api/slack_api_spec.rb +75 -0
- data/spec/models/auth_email_template_default_response_spec.rb +42 -0
- data/spec/models/auth_email_template_default_spec.rb +60 -0
- data/spec/models/{success_result_data_spec.rb → auth_email_template_delete_response_data_spec.rb} +6 -6
- data/spec/models/auth_email_template_delete_response_spec.rb +42 -0
- data/spec/models/auth_email_template_list_response_spec.rb +42 -0
- data/spec/models/auth_email_template_preview_draft_spec.rb +66 -0
- data/spec/models/auth_email_template_preview_request_spec.rb +42 -0
- data/spec/models/auth_email_template_preview_response_spec.rb +42 -0
- data/spec/models/auth_email_template_preview_result_spec.rb +60 -0
- data/spec/models/auth_email_template_response_spec.rb +42 -0
- data/spec/models/auth_email_template_spec.rb +112 -0
- data/spec/models/auth_email_template_test_request_spec.rb +42 -0
- data/spec/models/auth_email_template_test_response_spec.rb +42 -0
- data/spec/models/auth_email_template_test_result_spec.rb +42 -0
- data/spec/models/auth_email_template_version_spec.rb +100 -0
- data/spec/models/auth_email_template_versions_response_spec.rb +42 -0
- data/spec/models/auth_email_type_spec.rb +30 -0
- data/spec/models/bulk_upsert_auth_email_templates_request_spec.rb +48 -0
- data/spec/models/bulk_upsert_auth_email_templates_response_spec.rb +42 -0
- data/spec/models/send_slack_message_request_spec.rb +102 -0
- data/spec/models/send_slack_message_response_spec.rb +42 -0
- data/spec/models/send_slack_message_result_spec.rb +66 -0
- data/spec/models/slack_message_list_response_meta_spec.rb +54 -0
- data/spec/models/slack_message_list_response_spec.rb +42 -0
- data/spec/models/slack_message_response_spec.rb +42 -0
- data/spec/models/slack_message_spec.rb +132 -0
- data/spec/models/slack_message_status_spec.rb +30 -0
- data/spec/models/slack_message_summary_spec.rb +96 -0
- data/spec/models/upsert_auth_email_template_request_spec.rb +88 -0
- data/zyphr.gemspec +1 -1
- metadata +126 -6
|
@@ -0,0 +1,782 @@
|
|
|
1
|
+
# Zyphr::AuthEmailTemplatesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.zyphr.dev/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**bulk_upsert_auth_email_templates**](AuthEmailTemplatesApi.md#bulk_upsert_auth_email_templates) | **PUT** /auth/email-templates | Bulk-upsert auth email templates |
|
|
8
|
+
| [**delete_auth_email_template**](AuthEmailTemplatesApi.md#delete_auth_email_template) | **DELETE** /auth/email-templates/{type} | Remove a tenant override |
|
|
9
|
+
| [**get_auth_email_template**](AuthEmailTemplatesApi.md#get_auth_email_template) | **GET** /auth/email-templates/{type} | Get an auth email template |
|
|
10
|
+
| [**get_auth_email_template_default**](AuthEmailTemplatesApi.md#get_auth_email_template_default) | **GET** /auth/email-templates/{type}/default | Get the system default template |
|
|
11
|
+
| [**list_auth_email_template_versions**](AuthEmailTemplatesApi.md#list_auth_email_template_versions) | **GET** /auth/email-templates/{type}/versions | List version history for a template |
|
|
12
|
+
| [**list_auth_email_templates**](AuthEmailTemplatesApi.md#list_auth_email_templates) | **GET** /auth/email-templates | List auth email templates |
|
|
13
|
+
| [**preview_auth_email_template**](AuthEmailTemplatesApi.md#preview_auth_email_template) | **POST** /auth/email-templates/{type}/preview | Render a template with sample variables |
|
|
14
|
+
| [**restore_auth_email_template_version**](AuthEmailTemplatesApi.md#restore_auth_email_template_version) | **POST** /auth/email-templates/{type}/versions/{version}/restore | Restore a previous version |
|
|
15
|
+
| [**send_auth_email_template_test**](AuthEmailTemplatesApi.md#send_auth_email_template_test) | **POST** /auth/email-templates/{type}/test | Send a test render of a template |
|
|
16
|
+
| [**upsert_auth_email_template**](AuthEmailTemplatesApi.md#upsert_auth_email_template) | **PUT** /auth/email-templates/{type} | Create or update an auth email template |
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## bulk_upsert_auth_email_templates
|
|
20
|
+
|
|
21
|
+
> <BulkUpsertAuthEmailTemplatesResponse> bulk_upsert_auth_email_templates(bulk_upsert_auth_email_templates_request)
|
|
22
|
+
|
|
23
|
+
Bulk-upsert auth email templates
|
|
24
|
+
|
|
25
|
+
Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
26
|
+
|
|
27
|
+
### Examples
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
require 'time'
|
|
31
|
+
require 'zyphr'
|
|
32
|
+
# setup authorization
|
|
33
|
+
Zyphr.configure do |config|
|
|
34
|
+
# Configure API key authorization: ApplicationSecret
|
|
35
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
36
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
37
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
38
|
+
|
|
39
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
40
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
41
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
42
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
46
|
+
bulk_upsert_auth_email_templates_request = Zyphr::BulkUpsertAuthEmailTemplatesRequest.new # BulkUpsertAuthEmailTemplatesRequest |
|
|
47
|
+
|
|
48
|
+
begin
|
|
49
|
+
# Bulk-upsert auth email templates
|
|
50
|
+
result = api_instance.bulk_upsert_auth_email_templates(bulk_upsert_auth_email_templates_request)
|
|
51
|
+
p result
|
|
52
|
+
rescue Zyphr::ApiError => e
|
|
53
|
+
puts "Error when calling AuthEmailTemplatesApi->bulk_upsert_auth_email_templates: #{e}"
|
|
54
|
+
end
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Using the bulk_upsert_auth_email_templates_with_http_info variant
|
|
58
|
+
|
|
59
|
+
This returns an Array which contains the response data, status code and headers.
|
|
60
|
+
|
|
61
|
+
> <Array(<BulkUpsertAuthEmailTemplatesResponse>, Integer, Hash)> bulk_upsert_auth_email_templates_with_http_info(bulk_upsert_auth_email_templates_request)
|
|
62
|
+
|
|
63
|
+
```ruby
|
|
64
|
+
begin
|
|
65
|
+
# Bulk-upsert auth email templates
|
|
66
|
+
data, status_code, headers = api_instance.bulk_upsert_auth_email_templates_with_http_info(bulk_upsert_auth_email_templates_request)
|
|
67
|
+
p status_code # => 2xx
|
|
68
|
+
p headers # => { ... }
|
|
69
|
+
p data # => <BulkUpsertAuthEmailTemplatesResponse>
|
|
70
|
+
rescue Zyphr::ApiError => e
|
|
71
|
+
puts "Error when calling AuthEmailTemplatesApi->bulk_upsert_auth_email_templates_with_http_info: #{e}"
|
|
72
|
+
end
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Parameters
|
|
76
|
+
|
|
77
|
+
| Name | Type | Description | Notes |
|
|
78
|
+
| ---- | ---- | ----------- | ----- |
|
|
79
|
+
| **bulk_upsert_auth_email_templates_request** | [**BulkUpsertAuthEmailTemplatesRequest**](BulkUpsertAuthEmailTemplatesRequest.md) | | |
|
|
80
|
+
|
|
81
|
+
### Return type
|
|
82
|
+
|
|
83
|
+
[**BulkUpsertAuthEmailTemplatesResponse**](BulkUpsertAuthEmailTemplatesResponse.md)
|
|
84
|
+
|
|
85
|
+
### Authorization
|
|
86
|
+
|
|
87
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
88
|
+
|
|
89
|
+
### HTTP request headers
|
|
90
|
+
|
|
91
|
+
- **Content-Type**: application/json
|
|
92
|
+
- **Accept**: application/json
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## delete_auth_email_template
|
|
96
|
+
|
|
97
|
+
> <AuthEmailTemplateDeleteResponse> delete_auth_email_template(type)
|
|
98
|
+
|
|
99
|
+
Remove a tenant override
|
|
100
|
+
|
|
101
|
+
Reverts the application to the system default for this type
|
|
102
|
+
|
|
103
|
+
### Examples
|
|
104
|
+
|
|
105
|
+
```ruby
|
|
106
|
+
require 'time'
|
|
107
|
+
require 'zyphr'
|
|
108
|
+
# setup authorization
|
|
109
|
+
Zyphr.configure do |config|
|
|
110
|
+
# Configure API key authorization: ApplicationSecret
|
|
111
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
112
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
113
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
114
|
+
|
|
115
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
116
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
117
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
118
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
122
|
+
type = Zyphr::AuthEmailType::MAGIC_LINK # AuthEmailType |
|
|
123
|
+
|
|
124
|
+
begin
|
|
125
|
+
# Remove a tenant override
|
|
126
|
+
result = api_instance.delete_auth_email_template(type)
|
|
127
|
+
p result
|
|
128
|
+
rescue Zyphr::ApiError => e
|
|
129
|
+
puts "Error when calling AuthEmailTemplatesApi->delete_auth_email_template: #{e}"
|
|
130
|
+
end
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### Using the delete_auth_email_template_with_http_info variant
|
|
134
|
+
|
|
135
|
+
This returns an Array which contains the response data, status code and headers.
|
|
136
|
+
|
|
137
|
+
> <Array(<AuthEmailTemplateDeleteResponse>, Integer, Hash)> delete_auth_email_template_with_http_info(type)
|
|
138
|
+
|
|
139
|
+
```ruby
|
|
140
|
+
begin
|
|
141
|
+
# Remove a tenant override
|
|
142
|
+
data, status_code, headers = api_instance.delete_auth_email_template_with_http_info(type)
|
|
143
|
+
p status_code # => 2xx
|
|
144
|
+
p headers # => { ... }
|
|
145
|
+
p data # => <AuthEmailTemplateDeleteResponse>
|
|
146
|
+
rescue Zyphr::ApiError => e
|
|
147
|
+
puts "Error when calling AuthEmailTemplatesApi->delete_auth_email_template_with_http_info: #{e}"
|
|
148
|
+
end
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Parameters
|
|
152
|
+
|
|
153
|
+
| Name | Type | Description | Notes |
|
|
154
|
+
| ---- | ---- | ----------- | ----- |
|
|
155
|
+
| **type** | [**AuthEmailType**](.md) | | |
|
|
156
|
+
|
|
157
|
+
### Return type
|
|
158
|
+
|
|
159
|
+
[**AuthEmailTemplateDeleteResponse**](AuthEmailTemplateDeleteResponse.md)
|
|
160
|
+
|
|
161
|
+
### Authorization
|
|
162
|
+
|
|
163
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
164
|
+
|
|
165
|
+
### HTTP request headers
|
|
166
|
+
|
|
167
|
+
- **Content-Type**: Not defined
|
|
168
|
+
- **Accept**: application/json
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
## get_auth_email_template
|
|
172
|
+
|
|
173
|
+
> <AuthEmailTemplateResponse> get_auth_email_template(type)
|
|
174
|
+
|
|
175
|
+
Get an auth email template
|
|
176
|
+
|
|
177
|
+
Returns the override row for the given `type` if one exists, otherwise the system default. Use `is_default` to distinguish.
|
|
178
|
+
|
|
179
|
+
### Examples
|
|
180
|
+
|
|
181
|
+
```ruby
|
|
182
|
+
require 'time'
|
|
183
|
+
require 'zyphr'
|
|
184
|
+
# setup authorization
|
|
185
|
+
Zyphr.configure do |config|
|
|
186
|
+
# Configure API key authorization: ApplicationSecret
|
|
187
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
188
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
189
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
190
|
+
|
|
191
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
192
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
193
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
194
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
198
|
+
type = Zyphr::AuthEmailType::MAGIC_LINK # AuthEmailType |
|
|
199
|
+
|
|
200
|
+
begin
|
|
201
|
+
# Get an auth email template
|
|
202
|
+
result = api_instance.get_auth_email_template(type)
|
|
203
|
+
p result
|
|
204
|
+
rescue Zyphr::ApiError => e
|
|
205
|
+
puts "Error when calling AuthEmailTemplatesApi->get_auth_email_template: #{e}"
|
|
206
|
+
end
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### Using the get_auth_email_template_with_http_info variant
|
|
210
|
+
|
|
211
|
+
This returns an Array which contains the response data, status code and headers.
|
|
212
|
+
|
|
213
|
+
> <Array(<AuthEmailTemplateResponse>, Integer, Hash)> get_auth_email_template_with_http_info(type)
|
|
214
|
+
|
|
215
|
+
```ruby
|
|
216
|
+
begin
|
|
217
|
+
# Get an auth email template
|
|
218
|
+
data, status_code, headers = api_instance.get_auth_email_template_with_http_info(type)
|
|
219
|
+
p status_code # => 2xx
|
|
220
|
+
p headers # => { ... }
|
|
221
|
+
p data # => <AuthEmailTemplateResponse>
|
|
222
|
+
rescue Zyphr::ApiError => e
|
|
223
|
+
puts "Error when calling AuthEmailTemplatesApi->get_auth_email_template_with_http_info: #{e}"
|
|
224
|
+
end
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Parameters
|
|
228
|
+
|
|
229
|
+
| Name | Type | Description | Notes |
|
|
230
|
+
| ---- | ---- | ----------- | ----- |
|
|
231
|
+
| **type** | [**AuthEmailType**](.md) | | |
|
|
232
|
+
|
|
233
|
+
### Return type
|
|
234
|
+
|
|
235
|
+
[**AuthEmailTemplateResponse**](AuthEmailTemplateResponse.md)
|
|
236
|
+
|
|
237
|
+
### Authorization
|
|
238
|
+
|
|
239
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
240
|
+
|
|
241
|
+
### HTTP request headers
|
|
242
|
+
|
|
243
|
+
- **Content-Type**: Not defined
|
|
244
|
+
- **Accept**: application/json
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
## get_auth_email_template_default
|
|
248
|
+
|
|
249
|
+
> <AuthEmailTemplateDefaultResponse> get_auth_email_template_default(type)
|
|
250
|
+
|
|
251
|
+
Get the system default template
|
|
252
|
+
|
|
253
|
+
Returns the system default for the given type with Handlebars variables un-rendered. Useful for migration tooling fetch, modify, then PUT.
|
|
254
|
+
|
|
255
|
+
### Examples
|
|
256
|
+
|
|
257
|
+
```ruby
|
|
258
|
+
require 'time'
|
|
259
|
+
require 'zyphr'
|
|
260
|
+
# setup authorization
|
|
261
|
+
Zyphr.configure do |config|
|
|
262
|
+
# Configure API key authorization: ApplicationSecret
|
|
263
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
264
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
265
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
266
|
+
|
|
267
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
268
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
269
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
270
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
274
|
+
type = Zyphr::AuthEmailType::MAGIC_LINK # AuthEmailType |
|
|
275
|
+
|
|
276
|
+
begin
|
|
277
|
+
# Get the system default template
|
|
278
|
+
result = api_instance.get_auth_email_template_default(type)
|
|
279
|
+
p result
|
|
280
|
+
rescue Zyphr::ApiError => e
|
|
281
|
+
puts "Error when calling AuthEmailTemplatesApi->get_auth_email_template_default: #{e}"
|
|
282
|
+
end
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### Using the get_auth_email_template_default_with_http_info variant
|
|
286
|
+
|
|
287
|
+
This returns an Array which contains the response data, status code and headers.
|
|
288
|
+
|
|
289
|
+
> <Array(<AuthEmailTemplateDefaultResponse>, Integer, Hash)> get_auth_email_template_default_with_http_info(type)
|
|
290
|
+
|
|
291
|
+
```ruby
|
|
292
|
+
begin
|
|
293
|
+
# Get the system default template
|
|
294
|
+
data, status_code, headers = api_instance.get_auth_email_template_default_with_http_info(type)
|
|
295
|
+
p status_code # => 2xx
|
|
296
|
+
p headers # => { ... }
|
|
297
|
+
p data # => <AuthEmailTemplateDefaultResponse>
|
|
298
|
+
rescue Zyphr::ApiError => e
|
|
299
|
+
puts "Error when calling AuthEmailTemplatesApi->get_auth_email_template_default_with_http_info: #{e}"
|
|
300
|
+
end
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Parameters
|
|
304
|
+
|
|
305
|
+
| Name | Type | Description | Notes |
|
|
306
|
+
| ---- | ---- | ----------- | ----- |
|
|
307
|
+
| **type** | [**AuthEmailType**](.md) | | |
|
|
308
|
+
|
|
309
|
+
### Return type
|
|
310
|
+
|
|
311
|
+
[**AuthEmailTemplateDefaultResponse**](AuthEmailTemplateDefaultResponse.md)
|
|
312
|
+
|
|
313
|
+
### Authorization
|
|
314
|
+
|
|
315
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
316
|
+
|
|
317
|
+
### HTTP request headers
|
|
318
|
+
|
|
319
|
+
- **Content-Type**: Not defined
|
|
320
|
+
- **Accept**: application/json
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
## list_auth_email_template_versions
|
|
324
|
+
|
|
325
|
+
> <AuthEmailTemplateVersionsResponse> list_auth_email_template_versions(type)
|
|
326
|
+
|
|
327
|
+
List version history for a template
|
|
328
|
+
|
|
329
|
+
### Examples
|
|
330
|
+
|
|
331
|
+
```ruby
|
|
332
|
+
require 'time'
|
|
333
|
+
require 'zyphr'
|
|
334
|
+
# setup authorization
|
|
335
|
+
Zyphr.configure do |config|
|
|
336
|
+
# Configure API key authorization: ApplicationSecret
|
|
337
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
338
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
339
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
340
|
+
|
|
341
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
342
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
343
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
344
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
348
|
+
type = Zyphr::AuthEmailType::MAGIC_LINK # AuthEmailType |
|
|
349
|
+
|
|
350
|
+
begin
|
|
351
|
+
# List version history for a template
|
|
352
|
+
result = api_instance.list_auth_email_template_versions(type)
|
|
353
|
+
p result
|
|
354
|
+
rescue Zyphr::ApiError => e
|
|
355
|
+
puts "Error when calling AuthEmailTemplatesApi->list_auth_email_template_versions: #{e}"
|
|
356
|
+
end
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
#### Using the list_auth_email_template_versions_with_http_info variant
|
|
360
|
+
|
|
361
|
+
This returns an Array which contains the response data, status code and headers.
|
|
362
|
+
|
|
363
|
+
> <Array(<AuthEmailTemplateVersionsResponse>, Integer, Hash)> list_auth_email_template_versions_with_http_info(type)
|
|
364
|
+
|
|
365
|
+
```ruby
|
|
366
|
+
begin
|
|
367
|
+
# List version history for a template
|
|
368
|
+
data, status_code, headers = api_instance.list_auth_email_template_versions_with_http_info(type)
|
|
369
|
+
p status_code # => 2xx
|
|
370
|
+
p headers # => { ... }
|
|
371
|
+
p data # => <AuthEmailTemplateVersionsResponse>
|
|
372
|
+
rescue Zyphr::ApiError => e
|
|
373
|
+
puts "Error when calling AuthEmailTemplatesApi->list_auth_email_template_versions_with_http_info: #{e}"
|
|
374
|
+
end
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Parameters
|
|
378
|
+
|
|
379
|
+
| Name | Type | Description | Notes |
|
|
380
|
+
| ---- | ---- | ----------- | ----- |
|
|
381
|
+
| **type** | [**AuthEmailType**](.md) | | |
|
|
382
|
+
|
|
383
|
+
### Return type
|
|
384
|
+
|
|
385
|
+
[**AuthEmailTemplateVersionsResponse**](AuthEmailTemplateVersionsResponse.md)
|
|
386
|
+
|
|
387
|
+
### Authorization
|
|
388
|
+
|
|
389
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
390
|
+
|
|
391
|
+
### HTTP request headers
|
|
392
|
+
|
|
393
|
+
- **Content-Type**: Not defined
|
|
394
|
+
- **Accept**: application/json
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
## list_auth_email_templates
|
|
398
|
+
|
|
399
|
+
> <AuthEmailTemplateListResponse> list_auth_email_templates
|
|
400
|
+
|
|
401
|
+
List auth email templates
|
|
402
|
+
|
|
403
|
+
List the application's auth email templates. Returns one entry per email type; when no override exists for a type, the system default is returned with `is_default: true`.
|
|
404
|
+
|
|
405
|
+
### Examples
|
|
406
|
+
|
|
407
|
+
```ruby
|
|
408
|
+
require 'time'
|
|
409
|
+
require 'zyphr'
|
|
410
|
+
# setup authorization
|
|
411
|
+
Zyphr.configure do |config|
|
|
412
|
+
# Configure API key authorization: ApplicationSecret
|
|
413
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
414
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
415
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
416
|
+
|
|
417
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
418
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
419
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
420
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
424
|
+
|
|
425
|
+
begin
|
|
426
|
+
# List auth email templates
|
|
427
|
+
result = api_instance.list_auth_email_templates
|
|
428
|
+
p result
|
|
429
|
+
rescue Zyphr::ApiError => e
|
|
430
|
+
puts "Error when calling AuthEmailTemplatesApi->list_auth_email_templates: #{e}"
|
|
431
|
+
end
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
#### Using the list_auth_email_templates_with_http_info variant
|
|
435
|
+
|
|
436
|
+
This returns an Array which contains the response data, status code and headers.
|
|
437
|
+
|
|
438
|
+
> <Array(<AuthEmailTemplateListResponse>, Integer, Hash)> list_auth_email_templates_with_http_info
|
|
439
|
+
|
|
440
|
+
```ruby
|
|
441
|
+
begin
|
|
442
|
+
# List auth email templates
|
|
443
|
+
data, status_code, headers = api_instance.list_auth_email_templates_with_http_info
|
|
444
|
+
p status_code # => 2xx
|
|
445
|
+
p headers # => { ... }
|
|
446
|
+
p data # => <AuthEmailTemplateListResponse>
|
|
447
|
+
rescue Zyphr::ApiError => e
|
|
448
|
+
puts "Error when calling AuthEmailTemplatesApi->list_auth_email_templates_with_http_info: #{e}"
|
|
449
|
+
end
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Parameters
|
|
453
|
+
|
|
454
|
+
This endpoint does not need any parameter.
|
|
455
|
+
|
|
456
|
+
### Return type
|
|
457
|
+
|
|
458
|
+
[**AuthEmailTemplateListResponse**](AuthEmailTemplateListResponse.md)
|
|
459
|
+
|
|
460
|
+
### Authorization
|
|
461
|
+
|
|
462
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
463
|
+
|
|
464
|
+
### HTTP request headers
|
|
465
|
+
|
|
466
|
+
- **Content-Type**: Not defined
|
|
467
|
+
- **Accept**: application/json
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
## preview_auth_email_template
|
|
471
|
+
|
|
472
|
+
> <AuthEmailTemplatePreviewResponse> preview_auth_email_template(type, opts)
|
|
473
|
+
|
|
474
|
+
Render a template with sample variables
|
|
475
|
+
|
|
476
|
+
Returns subject/html/text rendered using sample variables (or caller-provided variables). No email is sent. Useful for dashboard previews and migration import validation.
|
|
477
|
+
|
|
478
|
+
### Examples
|
|
479
|
+
|
|
480
|
+
```ruby
|
|
481
|
+
require 'time'
|
|
482
|
+
require 'zyphr'
|
|
483
|
+
# setup authorization
|
|
484
|
+
Zyphr.configure do |config|
|
|
485
|
+
# Configure API key authorization: ApplicationSecret
|
|
486
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
487
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
488
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
489
|
+
|
|
490
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
491
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
492
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
493
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
497
|
+
type = Zyphr::AuthEmailType::MAGIC_LINK # AuthEmailType |
|
|
498
|
+
opts = {
|
|
499
|
+
auth_email_template_preview_request: Zyphr::AuthEmailTemplatePreviewRequest.new # AuthEmailTemplatePreviewRequest |
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
begin
|
|
503
|
+
# Render a template with sample variables
|
|
504
|
+
result = api_instance.preview_auth_email_template(type, opts)
|
|
505
|
+
p result
|
|
506
|
+
rescue Zyphr::ApiError => e
|
|
507
|
+
puts "Error when calling AuthEmailTemplatesApi->preview_auth_email_template: #{e}"
|
|
508
|
+
end
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
#### Using the preview_auth_email_template_with_http_info variant
|
|
512
|
+
|
|
513
|
+
This returns an Array which contains the response data, status code and headers.
|
|
514
|
+
|
|
515
|
+
> <Array(<AuthEmailTemplatePreviewResponse>, Integer, Hash)> preview_auth_email_template_with_http_info(type, opts)
|
|
516
|
+
|
|
517
|
+
```ruby
|
|
518
|
+
begin
|
|
519
|
+
# Render a template with sample variables
|
|
520
|
+
data, status_code, headers = api_instance.preview_auth_email_template_with_http_info(type, opts)
|
|
521
|
+
p status_code # => 2xx
|
|
522
|
+
p headers # => { ... }
|
|
523
|
+
p data # => <AuthEmailTemplatePreviewResponse>
|
|
524
|
+
rescue Zyphr::ApiError => e
|
|
525
|
+
puts "Error when calling AuthEmailTemplatesApi->preview_auth_email_template_with_http_info: #{e}"
|
|
526
|
+
end
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### Parameters
|
|
530
|
+
|
|
531
|
+
| Name | Type | Description | Notes |
|
|
532
|
+
| ---- | ---- | ----------- | ----- |
|
|
533
|
+
| **type** | [**AuthEmailType**](.md) | | |
|
|
534
|
+
| **auth_email_template_preview_request** | [**AuthEmailTemplatePreviewRequest**](AuthEmailTemplatePreviewRequest.md) | | [optional] |
|
|
535
|
+
|
|
536
|
+
### Return type
|
|
537
|
+
|
|
538
|
+
[**AuthEmailTemplatePreviewResponse**](AuthEmailTemplatePreviewResponse.md)
|
|
539
|
+
|
|
540
|
+
### Authorization
|
|
541
|
+
|
|
542
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
543
|
+
|
|
544
|
+
### HTTP request headers
|
|
545
|
+
|
|
546
|
+
- **Content-Type**: application/json
|
|
547
|
+
- **Accept**: application/json
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
## restore_auth_email_template_version
|
|
551
|
+
|
|
552
|
+
> <AuthEmailTemplateResponse> restore_auth_email_template_version(type, version)
|
|
553
|
+
|
|
554
|
+
Restore a previous version
|
|
555
|
+
|
|
556
|
+
Snapshots current state, then overwrites with the contents of the specified historical version.
|
|
557
|
+
|
|
558
|
+
### Examples
|
|
559
|
+
|
|
560
|
+
```ruby
|
|
561
|
+
require 'time'
|
|
562
|
+
require 'zyphr'
|
|
563
|
+
# setup authorization
|
|
564
|
+
Zyphr.configure do |config|
|
|
565
|
+
# Configure API key authorization: ApplicationSecret
|
|
566
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
567
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
568
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
569
|
+
|
|
570
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
571
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
572
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
573
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
574
|
+
end
|
|
575
|
+
|
|
576
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
577
|
+
type = Zyphr::AuthEmailType::MAGIC_LINK # AuthEmailType |
|
|
578
|
+
version = 56 # Integer |
|
|
579
|
+
|
|
580
|
+
begin
|
|
581
|
+
# Restore a previous version
|
|
582
|
+
result = api_instance.restore_auth_email_template_version(type, version)
|
|
583
|
+
p result
|
|
584
|
+
rescue Zyphr::ApiError => e
|
|
585
|
+
puts "Error when calling AuthEmailTemplatesApi->restore_auth_email_template_version: #{e}"
|
|
586
|
+
end
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
#### Using the restore_auth_email_template_version_with_http_info variant
|
|
590
|
+
|
|
591
|
+
This returns an Array which contains the response data, status code and headers.
|
|
592
|
+
|
|
593
|
+
> <Array(<AuthEmailTemplateResponse>, Integer, Hash)> restore_auth_email_template_version_with_http_info(type, version)
|
|
594
|
+
|
|
595
|
+
```ruby
|
|
596
|
+
begin
|
|
597
|
+
# Restore a previous version
|
|
598
|
+
data, status_code, headers = api_instance.restore_auth_email_template_version_with_http_info(type, version)
|
|
599
|
+
p status_code # => 2xx
|
|
600
|
+
p headers # => { ... }
|
|
601
|
+
p data # => <AuthEmailTemplateResponse>
|
|
602
|
+
rescue Zyphr::ApiError => e
|
|
603
|
+
puts "Error when calling AuthEmailTemplatesApi->restore_auth_email_template_version_with_http_info: #{e}"
|
|
604
|
+
end
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
### Parameters
|
|
608
|
+
|
|
609
|
+
| Name | Type | Description | Notes |
|
|
610
|
+
| ---- | ---- | ----------- | ----- |
|
|
611
|
+
| **type** | [**AuthEmailType**](.md) | | |
|
|
612
|
+
| **version** | **Integer** | | |
|
|
613
|
+
|
|
614
|
+
### Return type
|
|
615
|
+
|
|
616
|
+
[**AuthEmailTemplateResponse**](AuthEmailTemplateResponse.md)
|
|
617
|
+
|
|
618
|
+
### Authorization
|
|
619
|
+
|
|
620
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
621
|
+
|
|
622
|
+
### HTTP request headers
|
|
623
|
+
|
|
624
|
+
- **Content-Type**: Not defined
|
|
625
|
+
- **Accept**: application/json
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
## send_auth_email_template_test
|
|
629
|
+
|
|
630
|
+
> <AuthEmailTemplateTestResponse> send_auth_email_template_test(type, auth_email_template_test_request)
|
|
631
|
+
|
|
632
|
+
Send a test render of a template
|
|
633
|
+
|
|
634
|
+
Renders the template (override or default) using sample/provided variables and sends to the recipient. The recipient must be in the application `test_recipients` allowlist. Rate-limited.
|
|
635
|
+
|
|
636
|
+
### Examples
|
|
637
|
+
|
|
638
|
+
```ruby
|
|
639
|
+
require 'time'
|
|
640
|
+
require 'zyphr'
|
|
641
|
+
# setup authorization
|
|
642
|
+
Zyphr.configure do |config|
|
|
643
|
+
# Configure API key authorization: ApplicationSecret
|
|
644
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
645
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
646
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
647
|
+
|
|
648
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
649
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
650
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
651
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
652
|
+
end
|
|
653
|
+
|
|
654
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
655
|
+
type = Zyphr::AuthEmailType::MAGIC_LINK # AuthEmailType |
|
|
656
|
+
auth_email_template_test_request = Zyphr::AuthEmailTemplateTestRequest.new({to: 'to_example'}) # AuthEmailTemplateTestRequest |
|
|
657
|
+
|
|
658
|
+
begin
|
|
659
|
+
# Send a test render of a template
|
|
660
|
+
result = api_instance.send_auth_email_template_test(type, auth_email_template_test_request)
|
|
661
|
+
p result
|
|
662
|
+
rescue Zyphr::ApiError => e
|
|
663
|
+
puts "Error when calling AuthEmailTemplatesApi->send_auth_email_template_test: #{e}"
|
|
664
|
+
end
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
#### Using the send_auth_email_template_test_with_http_info variant
|
|
668
|
+
|
|
669
|
+
This returns an Array which contains the response data, status code and headers.
|
|
670
|
+
|
|
671
|
+
> <Array(<AuthEmailTemplateTestResponse>, Integer, Hash)> send_auth_email_template_test_with_http_info(type, auth_email_template_test_request)
|
|
672
|
+
|
|
673
|
+
```ruby
|
|
674
|
+
begin
|
|
675
|
+
# Send a test render of a template
|
|
676
|
+
data, status_code, headers = api_instance.send_auth_email_template_test_with_http_info(type, auth_email_template_test_request)
|
|
677
|
+
p status_code # => 2xx
|
|
678
|
+
p headers # => { ... }
|
|
679
|
+
p data # => <AuthEmailTemplateTestResponse>
|
|
680
|
+
rescue Zyphr::ApiError => e
|
|
681
|
+
puts "Error when calling AuthEmailTemplatesApi->send_auth_email_template_test_with_http_info: #{e}"
|
|
682
|
+
end
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
### Parameters
|
|
686
|
+
|
|
687
|
+
| Name | Type | Description | Notes |
|
|
688
|
+
| ---- | ---- | ----------- | ----- |
|
|
689
|
+
| **type** | [**AuthEmailType**](.md) | | |
|
|
690
|
+
| **auth_email_template_test_request** | [**AuthEmailTemplateTestRequest**](AuthEmailTemplateTestRequest.md) | | |
|
|
691
|
+
|
|
692
|
+
### Return type
|
|
693
|
+
|
|
694
|
+
[**AuthEmailTemplateTestResponse**](AuthEmailTemplateTestResponse.md)
|
|
695
|
+
|
|
696
|
+
### Authorization
|
|
697
|
+
|
|
698
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
699
|
+
|
|
700
|
+
### HTTP request headers
|
|
701
|
+
|
|
702
|
+
- **Content-Type**: application/json
|
|
703
|
+
- **Accept**: application/json
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
## upsert_auth_email_template
|
|
707
|
+
|
|
708
|
+
> <AuthEmailTemplateResponse> upsert_auth_email_template(type, upsert_auth_email_template_request)
|
|
709
|
+
|
|
710
|
+
Create or update an auth email template
|
|
711
|
+
|
|
712
|
+
Idempotent upsert keyed by application + type. MJML sources are compiled to HTML on save; compile errors return 400 with `details`.
|
|
713
|
+
|
|
714
|
+
### Examples
|
|
715
|
+
|
|
716
|
+
```ruby
|
|
717
|
+
require 'time'
|
|
718
|
+
require 'zyphr'
|
|
719
|
+
# setup authorization
|
|
720
|
+
Zyphr.configure do |config|
|
|
721
|
+
# Configure API key authorization: ApplicationSecret
|
|
722
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
723
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
724
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
725
|
+
|
|
726
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
727
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
728
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
729
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
730
|
+
end
|
|
731
|
+
|
|
732
|
+
api_instance = Zyphr::AuthEmailTemplatesApi.new
|
|
733
|
+
type = Zyphr::AuthEmailType::MAGIC_LINK # AuthEmailType |
|
|
734
|
+
upsert_auth_email_template_request = Zyphr::UpsertAuthEmailTemplateRequest.new # UpsertAuthEmailTemplateRequest |
|
|
735
|
+
|
|
736
|
+
begin
|
|
737
|
+
# Create or update an auth email template
|
|
738
|
+
result = api_instance.upsert_auth_email_template(type, upsert_auth_email_template_request)
|
|
739
|
+
p result
|
|
740
|
+
rescue Zyphr::ApiError => e
|
|
741
|
+
puts "Error when calling AuthEmailTemplatesApi->upsert_auth_email_template: #{e}"
|
|
742
|
+
end
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
#### Using the upsert_auth_email_template_with_http_info variant
|
|
746
|
+
|
|
747
|
+
This returns an Array which contains the response data, status code and headers.
|
|
748
|
+
|
|
749
|
+
> <Array(<AuthEmailTemplateResponse>, Integer, Hash)> upsert_auth_email_template_with_http_info(type, upsert_auth_email_template_request)
|
|
750
|
+
|
|
751
|
+
```ruby
|
|
752
|
+
begin
|
|
753
|
+
# Create or update an auth email template
|
|
754
|
+
data, status_code, headers = api_instance.upsert_auth_email_template_with_http_info(type, upsert_auth_email_template_request)
|
|
755
|
+
p status_code # => 2xx
|
|
756
|
+
p headers # => { ... }
|
|
757
|
+
p data # => <AuthEmailTemplateResponse>
|
|
758
|
+
rescue Zyphr::ApiError => e
|
|
759
|
+
puts "Error when calling AuthEmailTemplatesApi->upsert_auth_email_template_with_http_info: #{e}"
|
|
760
|
+
end
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
### Parameters
|
|
764
|
+
|
|
765
|
+
| Name | Type | Description | Notes |
|
|
766
|
+
| ---- | ---- | ----------- | ----- |
|
|
767
|
+
| **type** | [**AuthEmailType**](.md) | | |
|
|
768
|
+
| **upsert_auth_email_template_request** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | |
|
|
769
|
+
|
|
770
|
+
### Return type
|
|
771
|
+
|
|
772
|
+
[**AuthEmailTemplateResponse**](AuthEmailTemplateResponse.md)
|
|
773
|
+
|
|
774
|
+
### Authorization
|
|
775
|
+
|
|
776
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
777
|
+
|
|
778
|
+
### HTTP request headers
|
|
779
|
+
|
|
780
|
+
- **Content-Type**: application/json
|
|
781
|
+
- **Accept**: application/json
|
|
782
|
+
|