zavudev 0.11.0 → 0.12.0

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: 31fc9cb2bdd57145a425db99ba4a661bee75e90ba40c1e7cc67a162739fe37f9
4
- data.tar.gz: eb9e7b3ddd8cb6470d9c3b34f5bf9a53ca8692ae45e4fd36d3c9d328b180e8dd
3
+ metadata.gz: 17550e3e58db58719cdc2a8802e6c9002567e0415d2ed970324cc07efa240805
4
+ data.tar.gz: 4030a97737932b7c184a40188c9a005ef52acc79465bc60590c7bfa44c22f877
5
5
  SHA512:
6
- metadata.gz: 1242a227dd76d5a43f68581b50f92844963e81b8f392a1e71f613cad7c88f98a1c3b43fc63c1fc130ac23ac9bf7d740d8c0243be6e0ca7292545f6e76ff51942
7
- data.tar.gz: ca5d5b577c6210261dd24cae7d95466451134cb4a23e1b71648d64f83fa96ea684b99897afd94138e3d1644e0e425d0d9f7cc59aed7899175aa5a36df7ce3b27
6
+ metadata.gz: c1a8b5d82f24c1ebcb9c96cf117aa32f969a4fc5bb7d7343b2631e3af08dae6eeeccf5cb4ec63e5e42bdc6765b1c8a29dad659a9a880c552174f3981682ced5f
7
+ data.tar.gz: 1d27ac9df2216472ad34c826d690f46bde83aacf5281ca9a9672575dd2741ad545e8ed61ae460fdbceb211e0fdbca7b3839d94814f1e1d48059a2fe23cfe3bc3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.0 (2026-05-28)
4
+
5
+ Full Changelog: [v0.11.0...v0.12.0](https://github.com/zavudev/sdk-ruby/compare/v0.11.0...v0.12.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([7484922](https://github.com/zavudev/sdk-ruby/commit/7484922e1f6b8f8736e9ab45e562ea2e5a811ac9))
10
+ * **api:** api update ([efcc794](https://github.com/zavudev/sdk-ruby/commit/efcc794e638f0415a78888412f617a10ed16bb8b))
11
+
3
12
  ## 0.11.0 (2026-05-25)
4
13
 
5
14
  Full Changelog: [v0.10.0...v0.11.0](https://github.com/zavudev/sdk-ruby/compare/v0.10.0...v0.11.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "zavudev", "~> 0.11.0"
29
+ gem "zavudev", "~> 0.12.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -66,12 +66,19 @@ module Zavudev
66
66
  Zavudev::Internal::Type::HashOf[String],
67
67
  api_name: :templateButtonVariables
68
68
 
69
+ # @!attribute template_header_variables
70
+ #
71
+ # @return [Hash{Symbol=>String}, nil]
72
+ optional :template_header_variables,
73
+ Zavudev::Internal::Type::HashOf[String],
74
+ api_name: :templateHeaderVariables
75
+
69
76
  # @!attribute template_variables
70
77
  #
71
78
  # @return [Hash{Symbol=>String}, nil]
72
79
  optional :template_variables, Zavudev::Internal::Type::HashOf[String], api_name: :templateVariables
73
80
 
74
- # @!method initialize(id:, created_at:, recipient:, recipient_type:, status:, cost: nil, error_code: nil, error_message: nil, message_id: nil, processed_at: nil, template_button_variables: nil, template_variables: nil)
81
+ # @!method initialize(id:, created_at:, recipient:, recipient_type:, status:, cost: nil, error_code: nil, error_message: nil, message_id: nil, processed_at: nil, template_button_variables: nil, template_header_variables: nil, template_variables: nil)
75
82
  # @param id [String]
76
83
  #
77
84
  # @param created_at [Time]
@@ -94,6 +101,8 @@ module Zavudev
94
101
  #
95
102
  # @param template_button_variables [Hash{Symbol=>String}]
96
103
  #
104
+ # @param template_header_variables [Hash{Symbol=>String}]
105
+ #
97
106
  # @param template_variables [Hash{Symbol=>String}]
98
107
 
99
108
  # @see Zavudev::Models::BroadcastContact#recipient_type
@@ -36,6 +36,16 @@ module Zavudev
36
36
  Zavudev::Internal::Type::HashOf[String],
37
37
  api_name: :templateButtonVariables
38
38
 
39
+ # @!attribute template_header_variables
40
+ # Default value for a text-header variable, keyed by `1` (can be overridden per
41
+ # contact). If omitted, Zavu resolves the header from `templateVariables` by the
42
+ # header placeholder's name.
43
+ #
44
+ # @return [Hash{Symbol=>String}, nil]
45
+ optional :template_header_variables,
46
+ Zavudev::Internal::Type::HashOf[String],
47
+ api_name: :templateHeaderVariables
48
+
39
49
  # @!attribute template_id
40
50
  # Template ID for template messages.
41
51
  #
@@ -43,13 +53,15 @@ module Zavudev
43
53
  optional :template_id, String, api_name: :templateId
44
54
 
45
55
  # @!attribute template_variables
46
- # Default body variables (can be overridden per contact). Keys are positions (1,
47
- # 2, ...).
56
+ # Default body variables (can be overridden per contact). Key them to match the
57
+ # template body: by position (`1`, `2`, ...) for positional templates, or by name
58
+ # (e.g. `customer_name`) for named templates. Zavu detects the template's format
59
+ # and sends the correct payload to Meta. Do not mix positional and named keys.
48
60
  #
49
61
  # @return [Hash{Symbol=>String}, nil]
50
62
  optional :template_variables, Zavudev::Internal::Type::HashOf[String], api_name: :templateVariables
51
63
 
52
- # @!method initialize(filename: nil, media_id: nil, media_url: nil, mime_type: nil, template_button_variables: nil, template_id: nil, template_variables: nil)
64
+ # @!method initialize(filename: nil, media_id: nil, media_url: nil, mime_type: nil, template_button_variables: nil, template_header_variables: nil, template_id: nil, template_variables: nil)
53
65
  # Some parameter documentations has been truncated, see
54
66
  # {Zavudev::Models::BroadcastContent} for more details.
55
67
  #
@@ -65,9 +77,11 @@ module Zavudev
65
77
  #
66
78
  # @param template_button_variables [Hash{Symbol=>String}] Default button variables for dynamic URL/OTP buttons. Keys are the button index
67
79
  #
80
+ # @param template_header_variables [Hash{Symbol=>String}] Default value for a text-header variable, keyed by `1` (can be overridden per co
81
+ #
68
82
  # @param template_id [String] Template ID for template messages.
69
83
  #
70
- # @param template_variables [Hash{Symbol=>String}] Default body variables (can be overridden per contact). Keys are positions (1, 2
84
+ # @param template_variables [Hash{Symbol=>String}] Default body variables (can be overridden per contact). Key them to match the te
71
85
  end
72
86
  end
73
87
  end
@@ -43,14 +43,25 @@ module Zavudev
43
43
  Zavudev::Internal::Type::HashOf[String],
44
44
  api_name: :templateButtonVariables
45
45
 
46
+ # @!attribute template_header_variables
47
+ # Per-contact value for a text-header variable, keyed by `1`. If omitted, Zavu
48
+ # resolves the header from `templateVariables` by the header placeholder's name.
49
+ #
50
+ # @return [Hash{Symbol=>String}, nil]
51
+ optional :template_header_variables,
52
+ Zavudev::Internal::Type::HashOf[String],
53
+ api_name: :templateHeaderVariables
54
+
46
55
  # @!attribute template_variables
47
- # Per-contact body variables. Keys are positions (1, 2, ...) matching the order
48
- # placeholders appear in the template body.
56
+ # Per-contact body variables. Key them to match the template body: by position
57
+ # (`1`, `2`, ...) for positional templates, or by name (e.g. `customer_name`) for
58
+ # named templates. Zavu detects the template's format and sends the correct
59
+ # payload to Meta. Do not mix positional and named keys.
49
60
  #
50
61
  # @return [Hash{Symbol=>String}, nil]
51
62
  optional :template_variables, Zavudev::Internal::Type::HashOf[String], api_name: :templateVariables
52
63
 
53
- # @!method initialize(recipient:, template_button_variables: nil, template_variables: nil)
64
+ # @!method initialize(recipient:, template_button_variables: nil, template_header_variables: nil, template_variables: nil)
54
65
  # Some parameter documentations has been truncated, see
55
66
  # {Zavudev::Models::Broadcasts::ContactAddParams::Contact} for more details.
56
67
  #
@@ -58,7 +69,9 @@ module Zavudev
58
69
  #
59
70
  # @param template_button_variables [Hash{Symbol=>String}] Per-contact button variables for dynamic URL/OTP buttons. Keys are the button in
60
71
  #
61
- # @param template_variables [Hash{Symbol=>String}] Per-contact body variables. Keys are positions (1, 2, ...) matching the order pl
72
+ # @param template_header_variables [Hash{Symbol=>String}] Per-contact value for a text-header variable, keyed by `1`. If omitted, Zavu res
73
+ #
74
+ # @param template_variables [Hash{Symbol=>String}] Per-contact body variables. Key them to match the template body: by position (`1
62
75
  end
63
76
  end
64
77
  end
@@ -147,6 +147,17 @@ module Zavudev
147
147
  Zavudev::Internal::Type::HashOf[String],
148
148
  api_name: :templateButtonVariables
149
149
 
150
+ # @!attribute template_header_variables
151
+ # Value for a text-header variable, keyed by `1` (WhatsApp text headers allow at
152
+ # most one variable). Optional override. If omitted, Zavu resolves the header from
153
+ # `templateVariables` using the header placeholder's name (e.g. `novios`). Static
154
+ # text headers need no value.
155
+ #
156
+ # @return [Hash{Symbol=>String}, nil]
157
+ optional :template_header_variables,
158
+ Zavudev::Internal::Type::HashOf[String],
159
+ api_name: :templateHeaderVariables
160
+
150
161
  # @!attribute template_id
151
162
  # Template ID for template messages.
152
163
  #
@@ -154,13 +165,16 @@ module Zavudev
154
165
  optional :template_id, String, api_name: :templateId
155
166
 
156
167
  # @!attribute template_variables
157
- # Variables for body placeholders. Keys are positions (1, 2, 3, ...) matching the
158
- # order placeholders appear in the template body.
168
+ # Variables for body placeholders. Key them to match the template body: by
169
+ # position (`1`, `2`, ...) for positional templates, or by name (e.g.
170
+ # `customer_name`) for named templates. Zavu detects the template's format and
171
+ # sends the correct payload to Meta. Named keys also resolve a named text-header
172
+ # variable. Do not mix positional and named keys in the same request.
159
173
  #
160
174
  # @return [Hash{Symbol=>String}, nil]
161
175
  optional :template_variables, Zavudev::Internal::Type::HashOf[String], api_name: :templateVariables
162
176
 
163
- # @!method initialize(buttons: nil, contacts: nil, cta_display_text: nil, cta_header_media_url: nil, cta_header_text: nil, cta_header_type: nil, cta_url: nil, emoji: nil, filename: nil, footer_text: nil, latitude: nil, list_button: nil, location_address: nil, location_name: nil, longitude: nil, media_id: nil, media_url: nil, mime_type: nil, react_to_message_id: nil, sections: nil, template_button_variables: nil, template_id: nil, template_variables: nil)
177
+ # @!method initialize(buttons: nil, contacts: nil, cta_display_text: nil, cta_header_media_url: nil, cta_header_text: nil, cta_header_type: nil, cta_url: nil, emoji: nil, filename: nil, footer_text: nil, latitude: nil, list_button: nil, location_address: nil, location_name: nil, longitude: nil, media_id: nil, media_url: nil, mime_type: nil, react_to_message_id: nil, sections: nil, template_button_variables: nil, template_header_variables: nil, template_id: nil, template_variables: nil)
164
178
  # Some parameter documentations has been truncated, see
165
179
  # {Zavudev::Models::MessageContent} for more details.
166
180
  #
@@ -208,9 +222,11 @@ module Zavudev
208
222
  #
209
223
  # @param template_button_variables [Hash{Symbol=>String}] Variables for dynamic button placeholders (URL buttons and OTP buttons). Keys ar
210
224
  #
225
+ # @param template_header_variables [Hash{Symbol=>String}] Value for a text-header variable, keyed by `1` (WhatsApp text headers allow at m
226
+ #
211
227
  # @param template_id [String] Template ID for template messages.
212
228
  #
213
- # @param template_variables [Hash{Symbol=>String}] Variables for body placeholders. Keys are positions (1, 2, 3, ...) matching the
229
+ # @param template_variables [Hash{Symbol=>String}] Variables for body placeholders. Key them to match the template body: by positio
214
230
 
215
231
  class Button < Zavudev::Internal::Type::BaseModel
216
232
  # @!attribute id
@@ -10,8 +10,11 @@ module Zavudev
10
10
  required :id, String
11
11
 
12
12
  # @!attribute body
13
- # Default template body with variables: {{1}}, {{2}}, or named variables like
14
- # {{contact.first_name}}. Used when no channel-specific body is set.
13
+ # Default template body with variables: positional ({{1}}, {{2}}) or named
14
+ # ({{customer_name}}, {{contact.first_name}}). Templates created in Zavu are
15
+ # submitted to Meta as positional; templates imported from a WhatsApp Business
16
+ # Account keep their original format (named or positional). Used when no
17
+ # channel-specific body is set.
15
18
  #
16
19
  # @return [String]
17
20
  required :body, String
@@ -123,7 +126,7 @@ module Zavudev
123
126
  #
124
127
  # @param id [String]
125
128
  #
126
- # @param body [String] Default template body with variables: {{1}}, {{2}}, or named variables like {{co
129
+ # @param body [String] Default template body with variables: positional ({{1}}, {{2}}) or named ({{cust
127
130
  #
128
131
  # @param category [Symbol, Zavudev::Models::WhatsappCategory] WhatsApp template category.
129
132
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zavudev
4
- VERSION = "0.11.0"
4
+ VERSION = "0.12.0"
5
5
  end
@@ -58,6 +58,12 @@ module Zavudev
58
58
  sig { params(template_button_variables: T::Hash[Symbol, String]).void }
59
59
  attr_writer :template_button_variables
60
60
 
61
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
62
+ attr_reader :template_header_variables
63
+
64
+ sig { params(template_header_variables: T::Hash[Symbol, String]).void }
65
+ attr_writer :template_header_variables
66
+
61
67
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
62
68
  attr_reader :template_variables
63
69
 
@@ -77,6 +83,7 @@ module Zavudev
77
83
  message_id: String,
78
84
  processed_at: Time,
79
85
  template_button_variables: T::Hash[Symbol, String],
86
+ template_header_variables: T::Hash[Symbol, String],
80
87
  template_variables: T::Hash[Symbol, String]
81
88
  ).returns(T.attached_class)
82
89
  end
@@ -94,6 +101,7 @@ module Zavudev
94
101
  message_id: nil,
95
102
  processed_at: nil,
96
103
  template_button_variables: nil,
104
+ template_header_variables: nil,
97
105
  template_variables: nil
98
106
  )
99
107
  end
@@ -113,6 +121,7 @@ module Zavudev
113
121
  message_id: String,
114
122
  processed_at: Time,
115
123
  template_button_variables: T::Hash[Symbol, String],
124
+ template_header_variables: T::Hash[Symbol, String],
116
125
  template_variables: T::Hash[Symbol, String]
117
126
  }
118
127
  )
@@ -44,6 +44,15 @@ module Zavudev
44
44
  sig { params(template_button_variables: T::Hash[Symbol, String]).void }
45
45
  attr_writer :template_button_variables
46
46
 
47
+ # Default value for a text-header variable, keyed by `1` (can be overridden per
48
+ # contact). If omitted, Zavu resolves the header from `templateVariables` by the
49
+ # header placeholder's name.
50
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
51
+ attr_reader :template_header_variables
52
+
53
+ sig { params(template_header_variables: T::Hash[Symbol, String]).void }
54
+ attr_writer :template_header_variables
55
+
47
56
  # Template ID for template messages.
48
57
  sig { returns(T.nilable(String)) }
49
58
  attr_reader :template_id
@@ -51,8 +60,10 @@ module Zavudev
51
60
  sig { params(template_id: String).void }
52
61
  attr_writer :template_id
53
62
 
54
- # Default body variables (can be overridden per contact). Keys are positions (1,
55
- # 2, ...).
63
+ # Default body variables (can be overridden per contact). Key them to match the
64
+ # template body: by position (`1`, `2`, ...) for positional templates, or by name
65
+ # (e.g. `customer_name`) for named templates. Zavu detects the template's format
66
+ # and sends the correct payload to Meta. Do not mix positional and named keys.
56
67
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
57
68
  attr_reader :template_variables
58
69
 
@@ -67,6 +78,7 @@ module Zavudev
67
78
  media_url: String,
68
79
  mime_type: String,
69
80
  template_button_variables: T::Hash[Symbol, String],
81
+ template_header_variables: T::Hash[Symbol, String],
70
82
  template_id: String,
71
83
  template_variables: T::Hash[Symbol, String]
72
84
  ).returns(T.attached_class)
@@ -83,10 +95,16 @@ module Zavudev
83
95
  # Default button variables for dynamic URL/OTP buttons. Keys are the button index
84
96
  # (0, 1, 2). Per-contact values override these.
85
97
  template_button_variables: nil,
98
+ # Default value for a text-header variable, keyed by `1` (can be overridden per
99
+ # contact). If omitted, Zavu resolves the header from `templateVariables` by the
100
+ # header placeholder's name.
101
+ template_header_variables: nil,
86
102
  # Template ID for template messages.
87
103
  template_id: nil,
88
- # Default body variables (can be overridden per contact). Keys are positions (1,
89
- # 2, ...).
104
+ # Default body variables (can be overridden per contact). Key them to match the
105
+ # template body: by position (`1`, `2`, ...) for positional templates, or by name
106
+ # (e.g. `customer_name`) for named templates. Zavu detects the template's format
107
+ # and sends the correct payload to Meta. Do not mix positional and named keys.
90
108
  template_variables: nil
91
109
  )
92
110
  end
@@ -99,6 +117,7 @@ module Zavudev
99
117
  media_url: String,
100
118
  mime_type: String,
101
119
  template_button_variables: T::Hash[Symbol, String],
120
+ template_header_variables: T::Hash[Symbol, String],
102
121
  template_id: String,
103
122
  template_variables: T::Hash[Symbol, String]
104
123
  }
@@ -76,8 +76,20 @@ module Zavudev
76
76
  end
77
77
  attr_writer :template_button_variables
78
78
 
79
- # Per-contact body variables. Keys are positions (1, 2, ...) matching the order
80
- # placeholders appear in the template body.
79
+ # Per-contact value for a text-header variable, keyed by `1`. If omitted, Zavu
80
+ # resolves the header from `templateVariables` by the header placeholder's name.
81
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
82
+ attr_reader :template_header_variables
83
+
84
+ sig do
85
+ params(template_header_variables: T::Hash[Symbol, String]).void
86
+ end
87
+ attr_writer :template_header_variables
88
+
89
+ # Per-contact body variables. Key them to match the template body: by position
90
+ # (`1`, `2`, ...) for positional templates, or by name (e.g. `customer_name`) for
91
+ # named templates. Zavu detects the template's format and sends the correct
92
+ # payload to Meta. Do not mix positional and named keys.
81
93
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
82
94
  attr_reader :template_variables
83
95
 
@@ -88,6 +100,7 @@ module Zavudev
88
100
  params(
89
101
  recipient: String,
90
102
  template_button_variables: T::Hash[Symbol, String],
103
+ template_header_variables: T::Hash[Symbol, String],
91
104
  template_variables: T::Hash[Symbol, String]
92
105
  ).returns(T.attached_class)
93
106
  end
@@ -97,8 +110,13 @@ module Zavudev
97
110
  # Per-contact button variables for dynamic URL/OTP buttons. Keys are the button
98
111
  # index (0, 1, 2).
99
112
  template_button_variables: nil,
100
- # Per-contact body variables. Keys are positions (1, 2, ...) matching the order
101
- # placeholders appear in the template body.
113
+ # Per-contact value for a text-header variable, keyed by `1`. If omitted, Zavu
114
+ # resolves the header from `templateVariables` by the header placeholder's name.
115
+ template_header_variables: nil,
116
+ # Per-contact body variables. Key them to match the template body: by position
117
+ # (`1`, `2`, ...) for positional templates, or by name (e.g. `customer_name`) for
118
+ # named templates. Zavu detects the template's format and sends the correct
119
+ # payload to Meta. Do not mix positional and named keys.
102
120
  template_variables: nil
103
121
  )
104
122
  end
@@ -108,6 +126,7 @@ module Zavudev
108
126
  {
109
127
  recipient: String,
110
128
  template_button_variables: T::Hash[Symbol, String],
129
+ template_header_variables: T::Hash[Symbol, String],
111
130
  template_variables: T::Hash[Symbol, String]
112
131
  }
113
132
  )
@@ -187,6 +187,16 @@ module Zavudev
187
187
  sig { params(template_button_variables: T::Hash[Symbol, String]).void }
188
188
  attr_writer :template_button_variables
189
189
 
190
+ # Value for a text-header variable, keyed by `1` (WhatsApp text headers allow at
191
+ # most one variable). Optional override. If omitted, Zavu resolves the header from
192
+ # `templateVariables` using the header placeholder's name (e.g. `novios`). Static
193
+ # text headers need no value.
194
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
195
+ attr_reader :template_header_variables
196
+
197
+ sig { params(template_header_variables: T::Hash[Symbol, String]).void }
198
+ attr_writer :template_header_variables
199
+
190
200
  # Template ID for template messages.
191
201
  sig { returns(T.nilable(String)) }
192
202
  attr_reader :template_id
@@ -194,8 +204,11 @@ module Zavudev
194
204
  sig { params(template_id: String).void }
195
205
  attr_writer :template_id
196
206
 
197
- # Variables for body placeholders. Keys are positions (1, 2, 3, ...) matching the
198
- # order placeholders appear in the template body.
207
+ # Variables for body placeholders. Key them to match the template body: by
208
+ # position (`1`, `2`, ...) for positional templates, or by name (e.g.
209
+ # `customer_name`) for named templates. Zavu detects the template's format and
210
+ # sends the correct payload to Meta. Named keys also resolve a named text-header
211
+ # variable. Do not mix positional and named keys in the same request.
199
212
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
200
213
  attr_reader :template_variables
201
214
 
@@ -226,6 +239,7 @@ module Zavudev
226
239
  react_to_message_id: String,
227
240
  sections: T::Array[Zavudev::MessageContent::Section::OrHash],
228
241
  template_button_variables: T::Hash[Symbol, String],
242
+ template_header_variables: T::Hash[Symbol, String],
229
243
  template_id: String,
230
244
  template_variables: T::Hash[Symbol, String]
231
245
  ).returns(T.attached_class)
@@ -289,10 +303,18 @@ module Zavudev
289
303
  # - Static URL buttons (no placeholder) and `quick_reply` buttons are not included
290
304
  # here.
291
305
  template_button_variables: nil,
306
+ # Value for a text-header variable, keyed by `1` (WhatsApp text headers allow at
307
+ # most one variable). Optional override. If omitted, Zavu resolves the header from
308
+ # `templateVariables` using the header placeholder's name (e.g. `novios`). Static
309
+ # text headers need no value.
310
+ template_header_variables: nil,
292
311
  # Template ID for template messages.
293
312
  template_id: nil,
294
- # Variables for body placeholders. Keys are positions (1, 2, 3, ...) matching the
295
- # order placeholders appear in the template body.
313
+ # Variables for body placeholders. Key them to match the template body: by
314
+ # position (`1`, `2`, ...) for positional templates, or by name (e.g.
315
+ # `customer_name`) for named templates. Zavu detects the template's format and
316
+ # sends the correct payload to Meta. Named keys also resolve a named text-header
317
+ # variable. Do not mix positional and named keys in the same request.
296
318
  template_variables: nil
297
319
  )
298
320
  end
@@ -321,6 +343,7 @@ module Zavudev
321
343
  react_to_message_id: String,
322
344
  sections: T::Array[Zavudev::MessageContent::Section],
323
345
  template_button_variables: T::Hash[Symbol, String],
346
+ template_header_variables: T::Hash[Symbol, String],
324
347
  template_id: String,
325
348
  template_variables: T::Hash[Symbol, String]
326
349
  }
@@ -9,8 +9,11 @@ module Zavudev
9
9
  sig { returns(String) }
10
10
  attr_accessor :id
11
11
 
12
- # Default template body with variables: {{1}}, {{2}}, or named variables like
13
- # {{contact.first_name}}. Used when no channel-specific body is set.
12
+ # Default template body with variables: positional ({{1}}, {{2}}) or named
13
+ # ({{customer_name}}, {{contact.first_name}}). Templates created in Zavu are
14
+ # submitted to Meta as positional; templates imported from a WhatsApp Business
15
+ # Account keep their original format (named or positional). Used when no
16
+ # channel-specific body is set.
14
17
  sig { returns(String) }
15
18
  attr_accessor :body
16
19
 
@@ -146,8 +149,11 @@ module Zavudev
146
149
  end
147
150
  def self.new(
148
151
  id:,
149
- # Default template body with variables: {{1}}, {{2}}, or named variables like
150
- # {{contact.first_name}}. Used when no channel-specific body is set.
152
+ # Default template body with variables: positional ({{1}}, {{2}}) or named
153
+ # ({{customer_name}}, {{contact.first_name}}). Templates created in Zavu are
154
+ # submitted to Meta as positional; templates imported from a WhatsApp Business
155
+ # Account keep their original format (named or positional). Used when no
156
+ # channel-specific body is set.
151
157
  body:,
152
158
  # WhatsApp template category.
153
159
  category:,
@@ -13,6 +13,7 @@ module Zavudev
13
13
  message_id: String,
14
14
  processed_at: Time,
15
15
  template_button_variables: ::Hash[Symbol, String],
16
+ template_header_variables: ::Hash[Symbol, String],
16
17
  template_variables: ::Hash[Symbol, String]
17
18
  }
18
19
 
@@ -51,6 +52,12 @@ module Zavudev
51
52
  ::Hash[Symbol, String]
52
53
  ) -> ::Hash[Symbol, String]
53
54
 
55
+ attr_reader template_header_variables: ::Hash[Symbol, String]?
56
+
57
+ def template_header_variables=: (
58
+ ::Hash[Symbol, String]
59
+ ) -> ::Hash[Symbol, String]
60
+
54
61
  attr_reader template_variables: ::Hash[Symbol, String]?
55
62
 
56
63
  def template_variables=: (
@@ -69,6 +76,7 @@ module Zavudev
69
76
  ?message_id: String,
70
77
  ?processed_at: Time,
71
78
  ?template_button_variables: ::Hash[Symbol, String],
79
+ ?template_header_variables: ::Hash[Symbol, String],
72
80
  ?template_variables: ::Hash[Symbol, String]
73
81
  ) -> void
74
82
 
@@ -84,6 +92,7 @@ module Zavudev
84
92
  message_id: String,
85
93
  processed_at: Time,
86
94
  template_button_variables: ::Hash[Symbol, String],
95
+ template_header_variables: ::Hash[Symbol, String],
87
96
  template_variables: ::Hash[Symbol, String]
88
97
  }
89
98
 
@@ -7,6 +7,7 @@ module Zavudev
7
7
  media_url: String,
8
8
  mime_type: String,
9
9
  template_button_variables: ::Hash[Symbol, String],
10
+ template_header_variables: ::Hash[Symbol, String],
10
11
  template_id: String,
11
12
  template_variables: ::Hash[Symbol, String]
12
13
  }
@@ -34,6 +35,12 @@ module Zavudev
34
35
  ::Hash[Symbol, String]
35
36
  ) -> ::Hash[Symbol, String]
36
37
 
38
+ attr_reader template_header_variables: ::Hash[Symbol, String]?
39
+
40
+ def template_header_variables=: (
41
+ ::Hash[Symbol, String]
42
+ ) -> ::Hash[Symbol, String]
43
+
37
44
  attr_reader template_id: String?
38
45
 
39
46
  def template_id=: (String) -> String
@@ -50,6 +57,7 @@ module Zavudev
50
57
  ?media_url: String,
51
58
  ?mime_type: String,
52
59
  ?template_button_variables: ::Hash[Symbol, String],
60
+ ?template_header_variables: ::Hash[Symbol, String],
53
61
  ?template_id: String,
54
62
  ?template_variables: ::Hash[Symbol, String]
55
63
  ) -> void
@@ -60,6 +68,7 @@ module Zavudev
60
68
  media_url: String,
61
69
  mime_type: String,
62
70
  template_button_variables: ::Hash[Symbol, String],
71
+ template_header_variables: ::Hash[Symbol, String],
63
72
  template_id: String,
64
73
  template_variables: ::Hash[Symbol, String]
65
74
  }
@@ -32,6 +32,7 @@ module Zavudev
32
32
  {
33
33
  recipient: String,
34
34
  template_button_variables: ::Hash[Symbol, String],
35
+ template_header_variables: ::Hash[Symbol, String],
35
36
  template_variables: ::Hash[Symbol, String]
36
37
  }
37
38
 
@@ -44,6 +45,12 @@ module Zavudev
44
45
  ::Hash[Symbol, String]
45
46
  ) -> ::Hash[Symbol, String]
46
47
 
48
+ attr_reader template_header_variables: ::Hash[Symbol, String]?
49
+
50
+ def template_header_variables=: (
51
+ ::Hash[Symbol, String]
52
+ ) -> ::Hash[Symbol, String]
53
+
47
54
  attr_reader template_variables: ::Hash[Symbol, String]?
48
55
 
49
56
  def template_variables=: (
@@ -53,12 +60,14 @@ module Zavudev
53
60
  def initialize: (
54
61
  recipient: String,
55
62
  ?template_button_variables: ::Hash[Symbol, String],
63
+ ?template_header_variables: ::Hash[Symbol, String],
56
64
  ?template_variables: ::Hash[Symbol, String]
57
65
  ) -> void
58
66
 
59
67
  def to_hash: -> {
60
68
  recipient: String,
61
69
  template_button_variables: ::Hash[Symbol, String],
70
+ template_header_variables: ::Hash[Symbol, String],
62
71
  template_variables: ::Hash[Symbol, String]
63
72
  }
64
73
  end
@@ -23,6 +23,7 @@ module Zavudev
23
23
  react_to_message_id: String,
24
24
  sections: ::Array[Zavudev::MessageContent::Section],
25
25
  template_button_variables: ::Hash[Symbol, String],
26
+ template_header_variables: ::Hash[Symbol, String],
26
27
  template_id: String,
27
28
  template_variables: ::Hash[Symbol, String]
28
29
  }
@@ -122,6 +123,12 @@ module Zavudev
122
123
  ::Hash[Symbol, String]
123
124
  ) -> ::Hash[Symbol, String]
124
125
 
126
+ attr_reader template_header_variables: ::Hash[Symbol, String]?
127
+
128
+ def template_header_variables=: (
129
+ ::Hash[Symbol, String]
130
+ ) -> ::Hash[Symbol, String]
131
+
125
132
  attr_reader template_id: String?
126
133
 
127
134
  def template_id=: (String) -> String
@@ -154,6 +161,7 @@ module Zavudev
154
161
  ?react_to_message_id: String,
155
162
  ?sections: ::Array[Zavudev::MessageContent::Section],
156
163
  ?template_button_variables: ::Hash[Symbol, String],
164
+ ?template_header_variables: ::Hash[Symbol, String],
157
165
  ?template_id: String,
158
166
  ?template_variables: ::Hash[Symbol, String]
159
167
  ) -> void
@@ -180,6 +188,7 @@ module Zavudev
180
188
  react_to_message_id: String,
181
189
  sections: ::Array[Zavudev::MessageContent::Section],
182
190
  template_button_variables: ::Hash[Symbol, String],
191
+ template_header_variables: ::Hash[Symbol, String],
183
192
  template_id: String,
184
193
  template_variables: ::Hash[Symbol, String]
185
194
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zavudev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zavudev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-25 00:00:00.000000000 Z
11
+ date: 2026-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi