zyphr 0.1.23 → 0.1.24

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b8fcb1badee8f50b9507765d4c2bcc896b0b966dbae85a89028f881008176a9
4
- data.tar.gz: 6ba51b317d1e0f17d6c0becd75b2e8c616932c37a24a4c166c08fce7e50cb7cf
3
+ metadata.gz: a85b93ca7e767d1fbf04d38ecc50cd06a6b8f9cac57cb476c4598d8354f46ba9
4
+ data.tar.gz: 99e51428224ef0af2ede43492c38cba07d3cff36682b7562fe6477b8978e58f5
5
5
  SHA512:
6
- metadata.gz: ca806ff3567cfada05a98543b861f1974ab135e235edf03ad3ae4d4668a051817451f6503ab7c301bb5f02a9cb68649f64b7faa2fe5a98f1a0957e3079a6fbcf
7
- data.tar.gz: 5ce7284db506e4e5afaff6cd23da1178b36cb7d544ccd3c9fe908c7f3c083739662ee5d7731fb0a285026e54bed23e09bc3c0aa0d0c090d83c9c8ba20a43e6a2
6
+ metadata.gz: e8279a0d3c548f33c49d1fffdc0a7a93648da88d5afa7b2c1072076fdfa62b1170bb94ee1d104aead0d401b97bd818fca0db49e21c210bfad496beef441a0dba
7
+ data.tar.gz: 5635eea6e8c0de46184f8cd1d66204a360a9752347870730756d48de04b32f60be6171bbc857e4d9c94d9da3a3ae246c0cee96f807c27f53cd3c98cb4783fed9
data/README.md CHANGED
@@ -363,6 +363,7 @@ Class | Method | HTTP request | Description
363
363
  - [Zyphr::AuthUserResponse](docs/AuthUserResponse.md)
364
364
  - [Zyphr::AuthUserResponseData](docs/AuthUserResponseData.md)
365
365
  - [Zyphr::BatchPublishWaaSEvents201Response](docs/BatchPublishWaaSEvents201Response.md)
366
+ - [Zyphr::BatchRecipient](docs/BatchRecipient.md)
366
367
  - [Zyphr::BulkRetryWebhookDeliveriesRequest](docs/BulkRetryWebhookDeliveriesRequest.md)
367
368
  - [Zyphr::BulkUpsertAuthEmailTemplatesRequest](docs/BulkUpsertAuthEmailTemplatesRequest.md)
368
369
  - [Zyphr::BulkUpsertAuthEmailTemplatesResponse](docs/BulkUpsertAuthEmailTemplatesResponse.md)
@@ -0,0 +1,22 @@
1
+ # Zyphr::BatchRecipient
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **email** | **String** | | |
8
+ | **name** | **String** | | [optional] |
9
+ | **variables** | **Hash<String, Object>** | Per-recipient template variables. Merged on top of the batch-level `template_data`, so per-recipient values win on key collisions. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zyphr'
15
+
16
+ instance = Zyphr::BatchRecipient.new(
17
+ email: null,
18
+ name: null,
19
+ variables: null
20
+ )
21
+ ```
22
+
@@ -6,9 +6,9 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **name** | **String** | Template name (letters, numbers, underscores, hyphens) | |
8
8
  | **description** | **String** | | [optional] |
9
- | **subject** | **String** | Email subject line (supports Handlebars) | [optional] |
10
- | **html** | **String** | HTML body (supports Handlebars) | [optional] |
11
- | **text** | **String** | Plain text body (supports Handlebars) | [optional] |
9
+ | **subject** | **String** | Email subject line. Supports Handlebars `{{var}}` interpolation; values are HTML-escaped on render (see `html` field for the full escape policy). | [optional] |
10
+ | **html** | **String** | HTML body. Supports Handlebars `{{var}}` interpolation; values are always HTML-escaped on render. **Triple-brace `{{{var}}}` (raw HTML output) is not supported** for XSS-prevention reasons — input containing `{{{var}}}` is rewritten to `{{var}}` on save and the response includes a top-level `warnings` array describing what changed. To inject pre-rendered HTML, render the entire `html` field outside Zyphr and POST it to `/v1/email/send` directly without `template_id`. | [optional] |
11
+ | **text** | **String** | Plain text body. Supports Handlebars `{{var}}` interpolation; triple-brace syntax is rewritten to double-brace on save (same policy as the `html` field). | [optional] |
12
12
 
13
13
  ## Example
14
14
 
data/docs/EmailsApi.md CHANGED
@@ -310,7 +310,7 @@ end
310
310
 
311
311
  Send batch emails
312
312
 
313
- Send up to 100 emails in a single request. Each recipient gets their own message record.
313
+ Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
314
314
 
315
315
  ### Examples
316
316
 
@@ -326,7 +326,7 @@ Zyphr.configure do |config|
326
326
  end
327
327
 
328
328
  api_instance = Zyphr::EmailsApi.new
329
- send_batch_email_request = Zyphr::SendBatchEmailRequest.new({messages: [Zyphr::SendEmailRequest.new({to: [{"email": "user@example.com", "name": "John Doe"}], subject: 'Welcome to Zyphr!'})]}) # SendBatchEmailRequest |
329
+ send_batch_email_request = Zyphr::SendBatchEmailRequest.new({from: Zyphr::EmailAddress.new, to: [Zyphr::BatchRecipient.new({email: 'email_example'})]}) # SendBatchEmailRequest |
330
330
 
331
331
  begin
332
332
  # Send batch emails
@@ -4,7 +4,16 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **messages** | [**Array<SendEmailRequest>**](SendEmailRequest.md) | | |
7
+ | **from** | [**EmailAddress**](EmailAddress.md) | Sender address. The API also accepts a plain email string for convenience. | |
8
+ | **to** | [**Array<BatchRecipient>**](BatchRecipient.md) | | |
9
+ | **reply_to** | [**EmailAddress**](EmailAddress.md) | Reply-to address. The API also accepts a plain email string for convenience. | [optional] |
10
+ | **subject** | **String** | Required when sending raw content (no `template_id`). | [optional] |
11
+ | **html** | **String** | Provide either `html` or `text` (or both) when sending raw content. | [optional] |
12
+ | **text** | **String** | Provide either `html` or `text` (or both) when sending raw content. | [optional] |
13
+ | **template_id** | **String** | Template ID to use instead of raw `subject`/`html`/`text`. | [optional] |
14
+ | **template_data** | **Hash<String, Object>** | Default variables to pass to the template. Merged with each recipient's per-recipient `variables` (per-recipient values win on key collisions). | [optional] |
15
+ | **tags** | **Array<String>** | | [optional] |
16
+ | **metadata** | **Hash<String, Object>** | | [optional] |
8
17
 
9
18
  ## Example
10
19
 
@@ -12,7 +21,16 @@
12
21
  require 'zyphr'
13
22
 
14
23
  instance = Zyphr::SendBatchEmailRequest.new(
15
- messages: null
24
+ from: null,
25
+ to: null,
26
+ reply_to: null,
27
+ subject: null,
28
+ html: null,
29
+ text: null,
30
+ template_id: null,
31
+ template_data: null,
32
+ tags: null,
33
+ metadata: null
16
34
  )
17
35
  ```
18
36
 
@@ -6,6 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **data** | [**Template**](Template.md) | | [optional] |
8
8
  | **meta** | [**RequestMeta**](RequestMeta.md) | | [optional] |
9
+ | **warnings** | **Array<String>** | Non-fatal advisories about the request. Currently emitted only when the server rewrites template content for security (see the `html` field on `CreateTemplateRequest` for the triple-brace policy). Omitted entirely when no warnings apply — clients should treat its absence as equivalent to an empty array. | [optional] |
9
10
 
10
11
  ## Example
11
12
 
@@ -14,7 +15,8 @@ require 'zyphr'
14
15
 
15
16
  instance = Zyphr::TemplateResponse.new(
16
17
  data: null,
17
- meta: null
18
+ meta: null,
19
+ warnings: ["Stripped 1 occurrence(s) of triple-brace Handlebars syntax {{{var}}} from html. Raw HTML output is not supported for security reasons; values render HTML-escaped via {{var}}."]
18
20
  )
19
21
  ```
20
22
 
@@ -6,9 +6,9 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **name** | **String** | | [optional] |
8
8
  | **description** | **String** | | [optional] |
9
- | **subject** | **String** | | [optional] |
10
- | **html** | **String** | | [optional] |
11
- | **text** | **String** | | [optional] |
9
+ | **subject** | **String** | Email subject line. Supports Handlebars `{{var}}` interpolation (HTML-escaped on render). | [optional] |
10
+ | **html** | **String** | HTML body. Supports Handlebars `{{var}}` interpolation; values are always HTML-escaped on render. Triple-brace `{{{var}}}` is not supported — input is rewritten to `{{var}}` on save and the response includes a top-level `warnings` array describing the rewrite. See `CreateTemplateRequest.html` for full rationale. | [optional] |
11
+ | **text** | **String** | Plain text body. Supports Handlebars `{{var}}` interpolation; same triple-brace rewrite policy as `html`. | [optional] |
12
12
 
13
13
  ## Example
14
14
 
@@ -294,7 +294,7 @@ module Zyphr
294
294
  end
295
295
 
296
296
  # Send batch emails
297
- # Send up to 100 emails in a single request. Each recipient gets their own message record.
297
+ # Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
298
298
  # @param send_batch_email_request [SendBatchEmailRequest]
299
299
  # @param [Hash] opts the optional parameters
300
300
  # @return [SendBatchEmailResponse]
@@ -304,7 +304,7 @@ module Zyphr
304
304
  end
305
305
 
306
306
  # Send batch emails
307
- # Send up to 100 emails in a single request. Each recipient gets their own message record.
307
+ # Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
308
308
  # @param send_batch_email_request [SendBatchEmailRequest]
309
309
  # @param [Hash] opts the optional parameters
310
310
  # @return [Array<(SendBatchEmailResponse, Integer, Hash)>] SendBatchEmailResponse data, response status code and response headers
@@ -0,0 +1,258 @@
1
+ =begin
2
+ #Zyphr API
3
+
4
+ #Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@zyphr.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zyphr
17
+ class BatchRecipient
18
+ attr_accessor :email
19
+
20
+ attr_accessor :name
21
+
22
+ # Per-recipient template variables. Merged on top of the batch-level `template_data`, so per-recipient values win on key collisions.
23
+ attr_accessor :variables
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'email' => :'email',
29
+ :'name' => :'name',
30
+ :'variables' => :'variables'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'email' => :'String',
48
+ :'name' => :'String',
49
+ :'variables' => :'Hash<String, Object>'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::BatchRecipient` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::BatchRecipient`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'email')
76
+ self.email = attributes[:'email']
77
+ else
78
+ self.email = nil
79
+ end
80
+
81
+ if attributes.key?(:'name')
82
+ self.name = attributes[:'name']
83
+ end
84
+
85
+ if attributes.key?(:'variables')
86
+ if (value = attributes[:'variables']).is_a?(Hash)
87
+ self.variables = value
88
+ end
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
+ invalid_properties = Array.new
97
+ if @email.nil?
98
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ return false if @email.nil?
109
+ true
110
+ end
111
+
112
+ # Custom attribute writer method with validation
113
+ # @param [Object] email Value to be assigned
114
+ def email=(email)
115
+ if email.nil?
116
+ fail ArgumentError, 'email cannot be nil'
117
+ end
118
+
119
+ @email = email
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ email == o.email &&
128
+ name == o.name &&
129
+ variables == o.variables
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [email, name, variables].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ attributes = attributes.transform_keys(&:to_sym)
150
+ transformed_hash = {}
151
+ openapi_types.each_pair do |key, type|
152
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = nil
154
+ elsif type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[attribute_map[key]].is_a?(Array)
158
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
159
+ end
160
+ elsif !attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
162
+ end
163
+ end
164
+ new(transformed_hash)
165
+ end
166
+
167
+ # Deserializes the data based on type
168
+ # @param string type Data type
169
+ # @param string value Value to be deserialized
170
+ # @return [Object] Deserialized data
171
+ def self._deserialize(type, value)
172
+ case type.to_sym
173
+ when :Time
174
+ Time.parse(value)
175
+ when :Date
176
+ Date.parse(value)
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :Boolean
184
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when :Object
190
+ # generic object (usually a Hash), return directly
191
+ value
192
+ when /\AArray<(?<inner_type>.+)>\z/
193
+ inner_type = Regexp.last_match[:inner_type]
194
+ value.map { |v| _deserialize(inner_type, v) }
195
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
196
+ k_type = Regexp.last_match[:k_type]
197
+ v_type = Regexp.last_match[:v_type]
198
+ {}.tap do |hash|
199
+ value.each do |k, v|
200
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
+ end
202
+ end
203
+ else # model
204
+ # models (e.g. Pet) or oneOf
205
+ klass = Zyphr.const_get(type)
206
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ if value.nil?
229
+ is_nullable = self.class.openapi_nullable.include?(attr)
230
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
231
+ end
232
+
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+
256
+ end
257
+
258
+ end
@@ -20,13 +20,13 @@ module Zyphr
20
20
 
21
21
  attr_accessor :description
22
22
 
23
- # Email subject line (supports Handlebars)
23
+ # Email subject line. Supports Handlebars `{{var}}` interpolation; values are HTML-escaped on render (see `html` field for the full escape policy).
24
24
  attr_accessor :subject
25
25
 
26
- # HTML body (supports Handlebars)
26
+ # HTML body. Supports Handlebars `{{var}}` interpolation; values are always HTML-escaped on render. **Triple-brace `{{{var}}}` (raw HTML output) is not supported** for XSS-prevention reasons — input containing `{{{var}}}` is rewritten to `{{var}}` on save and the response includes a top-level `warnings` array describing what changed. To inject pre-rendered HTML, render the entire `html` field outside Zyphr and POST it to `/v1/email/send` directly without `template_id`.
27
27
  attr_accessor :html
28
28
 
29
- # Plain text body (supports Handlebars)
29
+ # Plain text body. Supports Handlebars `{{var}}` interpolation; triple-brace syntax is rewritten to double-brace on save (same policy as the `html` field).
30
30
  attr_accessor :text
31
31
 
32
32
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,13 +14,48 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zyphr
17
+ # Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`.
17
18
  class SendBatchEmailRequest
18
- attr_accessor :messages
19
+ # Sender address. The API also accepts a plain email string for convenience.
20
+ attr_accessor :from
21
+
22
+ attr_accessor :to
23
+
24
+ # Reply-to address. The API also accepts a plain email string for convenience.
25
+ attr_accessor :reply_to
26
+
27
+ # Required when sending raw content (no `template_id`).
28
+ attr_accessor :subject
29
+
30
+ # Provide either `html` or `text` (or both) when sending raw content.
31
+ attr_accessor :html
32
+
33
+ # Provide either `html` or `text` (or both) when sending raw content.
34
+ attr_accessor :text
35
+
36
+ # Template ID to use instead of raw `subject`/`html`/`text`.
37
+ attr_accessor :template_id
38
+
39
+ # Default variables to pass to the template. Merged with each recipient's per-recipient `variables` (per-recipient values win on key collisions).
40
+ attr_accessor :template_data
41
+
42
+ attr_accessor :tags
43
+
44
+ attr_accessor :metadata
19
45
 
20
46
  # Attribute mapping from ruby-style variable name to JSON key.
21
47
  def self.attribute_map
22
48
  {
23
- :'messages' => :'messages'
49
+ :'from' => :'from',
50
+ :'to' => :'to',
51
+ :'reply_to' => :'reply_to',
52
+ :'subject' => :'subject',
53
+ :'html' => :'html',
54
+ :'text' => :'text',
55
+ :'template_id' => :'template_id',
56
+ :'template_data' => :'template_data',
57
+ :'tags' => :'tags',
58
+ :'metadata' => :'metadata'
24
59
  }
25
60
  end
26
61
 
@@ -37,7 +72,16 @@ module Zyphr
37
72
  # Attribute type mapping.
38
73
  def self.openapi_types
39
74
  {
40
- :'messages' => :'Array<SendEmailRequest>'
75
+ :'from' => :'EmailAddress',
76
+ :'to' => :'Array<BatchRecipient>',
77
+ :'reply_to' => :'EmailAddress',
78
+ :'subject' => :'String',
79
+ :'html' => :'String',
80
+ :'text' => :'String',
81
+ :'template_id' => :'String',
82
+ :'template_data' => :'Hash<String, Object>',
83
+ :'tags' => :'Array<String>',
84
+ :'metadata' => :'Hash<String, Object>'
41
85
  }
42
86
  end
43
87
 
@@ -63,12 +107,56 @@ module Zyphr
63
107
  h[k.to_sym] = v
64
108
  }
65
109
 
66
- if attributes.key?(:'messages')
67
- if (value = attributes[:'messages']).is_a?(Array)
68
- self.messages = value
110
+ if attributes.key?(:'from')
111
+ self.from = attributes[:'from']
112
+ else
113
+ self.from = nil
114
+ end
115
+
116
+ if attributes.key?(:'to')
117
+ if (value = attributes[:'to']).is_a?(Array)
118
+ self.to = value
69
119
  end
70
120
  else
71
- self.messages = nil
121
+ self.to = nil
122
+ end
123
+
124
+ if attributes.key?(:'reply_to')
125
+ self.reply_to = attributes[:'reply_to']
126
+ end
127
+
128
+ if attributes.key?(:'subject')
129
+ self.subject = attributes[:'subject']
130
+ end
131
+
132
+ if attributes.key?(:'html')
133
+ self.html = attributes[:'html']
134
+ end
135
+
136
+ if attributes.key?(:'text')
137
+ self.text = attributes[:'text']
138
+ end
139
+
140
+ if attributes.key?(:'template_id')
141
+ self.template_id = attributes[:'template_id']
142
+ end
143
+
144
+ if attributes.key?(:'template_data')
145
+ if (value = attributes[:'template_data']).is_a?(Hash)
146
+ self.template_data = value
147
+ end
148
+ end
149
+
150
+ if attributes.key?(:'tags')
151
+ if (value = attributes[:'tags']).is_a?(Array)
152
+ self.tags = value
153
+ end
154
+ end
155
+
156
+ if attributes.key?(:'metadata')
157
+ if (value = attributes[:'metadata']).is_a?(Hash)
158
+ self.metadata = value
159
+ end
72
160
  end
73
161
  end
74
162
 
@@ -77,12 +165,24 @@ module Zyphr
77
165
  def list_invalid_properties
78
166
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
167
  invalid_properties = Array.new
80
- if @messages.nil?
81
- invalid_properties.push('invalid value for "messages", messages cannot be nil.')
168
+ if @from.nil?
169
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
170
+ end
171
+
172
+ if @to.nil?
173
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
82
174
  end
83
175
 
84
- if @messages.length > 100
85
- invalid_properties.push('invalid value for "messages", number of items must be less than or equal to 100.')
176
+ if @to.length > 100
177
+ invalid_properties.push('invalid value for "to", number of items must be less than or equal to 100.')
178
+ end
179
+
180
+ if @to.length < 1
181
+ invalid_properties.push('invalid value for "to", number of items must be greater than or equal to 1.')
182
+ end
183
+
184
+ if !@tags.nil? && @tags.length > 10
185
+ invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 10.')
86
186
  end
87
187
 
88
188
  invalid_properties
@@ -92,23 +192,54 @@ module Zyphr
92
192
  # @return true if the model is valid
93
193
  def valid?
94
194
  warn '[DEPRECATED] the `valid?` method is obsolete'
95
- return false if @messages.nil?
96
- return false if @messages.length > 100
195
+ return false if @from.nil?
196
+ return false if @to.nil?
197
+ return false if @to.length > 100
198
+ return false if @to.length < 1
199
+ return false if !@tags.nil? && @tags.length > 10
97
200
  true
98
201
  end
99
202
 
100
203
  # Custom attribute writer method with validation
101
- # @param [Object] messages Value to be assigned
102
- def messages=(messages)
103
- if messages.nil?
104
- fail ArgumentError, 'messages cannot be nil'
204
+ # @param [Object] from Value to be assigned
205
+ def from=(from)
206
+ if from.nil?
207
+ fail ArgumentError, 'from cannot be nil'
208
+ end
209
+
210
+ @from = from
211
+ end
212
+
213
+ # Custom attribute writer method with validation
214
+ # @param [Object] to Value to be assigned
215
+ def to=(to)
216
+ if to.nil?
217
+ fail ArgumentError, 'to cannot be nil'
218
+ end
219
+
220
+ if to.length > 100
221
+ fail ArgumentError, 'invalid value for "to", number of items must be less than or equal to 100.'
222
+ end
223
+
224
+ if to.length < 1
225
+ fail ArgumentError, 'invalid value for "to", number of items must be greater than or equal to 1.'
226
+ end
227
+
228
+ @to = to
229
+ end
230
+
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] tags Value to be assigned
233
+ def tags=(tags)
234
+ if tags.nil?
235
+ fail ArgumentError, 'tags cannot be nil'
105
236
  end
106
237
 
107
- if messages.length > 100
108
- fail ArgumentError, 'invalid value for "messages", number of items must be less than or equal to 100.'
238
+ if tags.length > 10
239
+ fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 10.'
109
240
  end
110
241
 
111
- @messages = messages
242
+ @tags = tags
112
243
  end
113
244
 
114
245
  # Checks equality by comparing each attribute.
@@ -116,7 +247,16 @@ module Zyphr
116
247
  def ==(o)
117
248
  return true if self.equal?(o)
118
249
  self.class == o.class &&
119
- messages == o.messages
250
+ from == o.from &&
251
+ to == o.to &&
252
+ reply_to == o.reply_to &&
253
+ subject == o.subject &&
254
+ html == o.html &&
255
+ text == o.text &&
256
+ template_id == o.template_id &&
257
+ template_data == o.template_data &&
258
+ tags == o.tags &&
259
+ metadata == o.metadata
120
260
  end
121
261
 
122
262
  # @see the `==` method
@@ -128,7 +268,7 @@ module Zyphr
128
268
  # Calculates hash code according to all attributes.
129
269
  # @return [Integer] Hash code
130
270
  def hash
131
- [messages].hash
271
+ [from, to, reply_to, subject, html, text, template_id, template_data, tags, metadata].hash
132
272
  end
133
273
 
134
274
  # Builds the object from hash
@@ -19,11 +19,15 @@ module Zyphr
19
19
 
20
20
  attr_accessor :meta
21
21
 
22
+ # Non-fatal advisories about the request. Currently emitted only when the server rewrites template content for security (see the `html` field on `CreateTemplateRequest` for the triple-brace policy). Omitted entirely when no warnings apply — clients should treat its absence as equivalent to an empty array.
23
+ attr_accessor :warnings
24
+
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
23
26
  def self.attribute_map
24
27
  {
25
28
  :'data' => :'data',
26
- :'meta' => :'meta'
29
+ :'meta' => :'meta',
30
+ :'warnings' => :'warnings'
27
31
  }
28
32
  end
29
33
 
@@ -41,7 +45,8 @@ module Zyphr
41
45
  def self.openapi_types
42
46
  {
43
47
  :'data' => :'Template',
44
- :'meta' => :'RequestMeta'
48
+ :'meta' => :'RequestMeta',
49
+ :'warnings' => :'Array<String>'
45
50
  }
46
51
  end
47
52
 
@@ -74,6 +79,12 @@ module Zyphr
74
79
  if attributes.key?(:'meta')
75
80
  self.meta = attributes[:'meta']
76
81
  end
82
+
83
+ if attributes.key?(:'warnings')
84
+ if (value = attributes[:'warnings']).is_a?(Array)
85
+ self.warnings = value
86
+ end
87
+ end
77
88
  end
78
89
 
79
90
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -97,7 +108,8 @@ module Zyphr
97
108
  return true if self.equal?(o)
98
109
  self.class == o.class &&
99
110
  data == o.data &&
100
- meta == o.meta
111
+ meta == o.meta &&
112
+ warnings == o.warnings
101
113
  end
102
114
 
103
115
  # @see the `==` method
@@ -109,7 +121,7 @@ module Zyphr
109
121
  # Calculates hash code according to all attributes.
110
122
  # @return [Integer] Hash code
111
123
  def hash
112
- [data, meta].hash
124
+ [data, meta, warnings].hash
113
125
  end
114
126
 
115
127
  # Builds the object from hash
@@ -19,10 +19,13 @@ module Zyphr
19
19
 
20
20
  attr_accessor :description
21
21
 
22
+ # Email subject line. Supports Handlebars `{{var}}` interpolation (HTML-escaped on render).
22
23
  attr_accessor :subject
23
24
 
25
+ # HTML body. Supports Handlebars `{{var}}` interpolation; values are always HTML-escaped on render. Triple-brace `{{{var}}}` is not supported — input is rewritten to `{{var}}` on save and the response includes a top-level `warnings` array describing the rewrite. See `CreateTemplateRequest.html` for full rationale.
24
26
  attr_accessor :html
25
27
 
28
+ # Plain text body. Supports Handlebars `{{var}}` interpolation; same triple-brace rewrite policy as `html`.
26
29
  attr_accessor :text
27
30
 
28
31
  # Attribute mapping from ruby-style variable name to JSON key.
data/lib/zyphr.rb CHANGED
@@ -49,6 +49,7 @@ require 'zyphr/models/auth_user'
49
49
  require 'zyphr/models/auth_user_response'
50
50
  require 'zyphr/models/auth_user_response_data'
51
51
  require 'zyphr/models/batch_publish_waa_s_events201_response'
52
+ require 'zyphr/models/batch_recipient'
52
53
  require 'zyphr/models/bulk_retry_webhook_deliveries_request'
53
54
  require 'zyphr/models/bulk_upsert_auth_email_templates_request'
54
55
  require 'zyphr/models/bulk_upsert_auth_email_templates_response'
@@ -85,7 +85,7 @@ describe 'EmailsApi' do
85
85
 
86
86
  # unit tests for send_batch_email
87
87
  # Send batch emails
88
- # Send up to 100 emails in a single request. Each recipient gets their own message record.
88
+ # Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (&#x60;subject&#x60; plus &#x60;html&#x60; and/or &#x60;text&#x60;) or a &#x60;template_id&#x60; with &#x60;template_data&#x60;. Per-recipient &#x60;variables&#x60; are merged on top of the batch-level &#x60;template_data&#x60;.
89
89
  # @param send_batch_email_request
90
90
  # @param [Hash] opts the optional parameters
91
91
  # @return [SendBatchEmailResponse]
@@ -0,0 +1,48 @@
1
+ =begin
2
+ #Zyphr API
3
+
4
+ #Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@zyphr.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zyphr::BatchRecipient
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zyphr::BatchRecipient do
21
+ let(:instance) { Zyphr::BatchRecipient.new }
22
+
23
+ describe 'test an instance of BatchRecipient' do
24
+ it 'should create an instance of BatchRecipient' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zyphr::BatchRecipient)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "email"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "name"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "variables"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ end
@@ -27,7 +27,61 @@ describe Zyphr::SendBatchEmailRequest do
27
27
  end
28
28
  end
29
29
 
30
- describe 'test attribute "messages"' do
30
+ describe 'test attribute "from"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "to"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "reply_to"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ describe 'test attribute "subject"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
+ end
52
+ end
53
+
54
+ describe 'test attribute "html"' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
+ end
58
+ end
59
+
60
+ describe 'test attribute "text"' do
61
+ it 'should work' do
62
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
63
+ end
64
+ end
65
+
66
+ describe 'test attribute "template_id"' do
67
+ it 'should work' do
68
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
69
+ end
70
+ end
71
+
72
+ describe 'test attribute "template_data"' do
73
+ it 'should work' do
74
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
75
+ end
76
+ end
77
+
78
+ describe 'test attribute "tags"' do
79
+ it 'should work' do
80
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
81
+ end
82
+ end
83
+
84
+ describe 'test attribute "metadata"' do
31
85
  it 'should work' do
32
86
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
87
  end
@@ -39,4 +39,10 @@ describe Zyphr::TemplateResponse do
39
39
  end
40
40
  end
41
41
 
42
+ describe 'test attribute "warnings"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
42
48
  end
data/zyphr.gemspec CHANGED
@@ -17,7 +17,7 @@ require "zyphr/version"
17
17
 
18
18
  Gem::Specification.new do |s|
19
19
  s.name = "zyphr"
20
- s.version = '0.1.23'
20
+ s.version = '0.1.24'
21
21
  s.platform = Gem::Platform::RUBY
22
22
  s.authors = ["Zyphr"]
23
23
  s.email = ["support@zyphr.dev"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zyphr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zyphr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-09 00:00:00.000000000 Z
11
+ date: 2026-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -132,6 +132,7 @@ files:
132
132
  - docs/AuthUserResponseData.md
133
133
  - docs/AuthWebAuthnApi.md
134
134
  - docs/BatchPublishWaaSEvents201Response.md
135
+ - docs/BatchRecipient.md
135
136
  - docs/BulkRetryWebhookDeliveriesRequest.md
136
137
  - docs/BulkUpsertAuthEmailTemplatesRequest.md
137
138
  - docs/BulkUpsertAuthEmailTemplatesResponse.md
@@ -557,6 +558,7 @@ files:
557
558
  - lib/zyphr/models/auth_user_response.rb
558
559
  - lib/zyphr/models/auth_user_response_data.rb
559
560
  - lib/zyphr/models/batch_publish_waa_s_events201_response.rb
561
+ - lib/zyphr/models/batch_recipient.rb
560
562
  - lib/zyphr/models/bulk_retry_webhook_deliveries_request.rb
561
563
  - lib/zyphr/models/bulk_upsert_auth_email_templates_request.rb
562
564
  - lib/zyphr/models/bulk_upsert_auth_email_templates_response.rb
@@ -960,6 +962,7 @@ files:
960
962
  - spec/models/auth_user_response_spec.rb
961
963
  - spec/models/auth_user_spec.rb
962
964
  - spec/models/batch_publish_waa_s_events201_response_spec.rb
965
+ - spec/models/batch_recipient_spec.rb
963
966
  - spec/models/bulk_retry_webhook_deliveries_request_spec.rb
964
967
  - spec/models/bulk_upsert_auth_email_templates_request_spec.rb
965
968
  - spec/models/bulk_upsert_auth_email_templates_response_spec.rb
@@ -1433,6 +1436,7 @@ test_files:
1433
1436
  - spec/models/list_waa_s_endpoints200_response_spec.rb
1434
1437
  - spec/models/push_message_spec.rb
1435
1438
  - spec/models/sms_config_delete_response_data_spec.rb
1439
+ - spec/models/batch_recipient_spec.rb
1436
1440
  - spec/models/waa_s_batch_publish_request_spec.rb
1437
1441
  - spec/models/topic_subscribers_add_response_spec.rb
1438
1442
  - spec/models/consent_record_response_spec.rb