Class: Telnyx::Models::EmailMessageBatchParams::Message

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/email_message_batch_params.rb,
sig/telnyx/models/email_message_batch_params.rbs

Constant Summary collapse

Telnyx =

Returns:

  • (:TrackingSettings)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(from:, to:, attachments: nil, bcc: nil, cc: nil, from_name: nil, group_id: nil, headers: nil, html_body: nil, ignore_suppression: nil, inline_css: nil, metadata: nil, reply_to: nil, sandbox_mode: nil, scheduled_at: nil, send_at: nil, subject: nil, tags: nil, template_id: nil, template_variables: nil, text_body: nil, tracking_settings: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::EmailMessageBatchParams::Message for more details.

A single message in a batch create request. This schema mirrors CreateEmailRequest EXCEPT it does not accept the reply/forward threading parameters (in_reply_to_message_id, reply_to_all, forward_of_message_id) — those are single-send-only in Phase 1 (MSG-1491) and are not yet implemented on the batch endpoint. Recipient email addresses must be unique across to, cc, and bcc after case-insensitive normalization. Duplicate recipients return 400.

Parameters:

  • from (String, Telnyx::Models::EmailInboxes::EmailAddress)
  • to (Array<String, Telnyx::Models::EmailInboxes::EmailAddress>)
  • attachments (Array<Telnyx::Models::AttachmentRequest>) (defaults to: nil)
  • bcc (Array<String, Telnyx::Models::EmailInboxes::EmailAddress>) (defaults to: nil)
  • cc (Array<String, Telnyx::Models::EmailInboxes::EmailAddress>) (defaults to: nil)
  • from_name (String) (defaults to: nil)

    Optional display name for string from; overrides from.name when provided.

  • group_id (String, nil) (defaults to: nil)

    Optional unsubscribe-group UUID used for group-scoped suppression checks and uns

  • headers (Hash{Symbol=>String}) (defaults to: nil)

    Custom email headers. Write-only; not returned in responses.

  • html_body (String) (defaults to: nil)

    HTML email body. Returned only by GET /email_messages/{id}; omitted from creat

  • ignore_suppression (Boolean) (defaults to: nil)

    When true, allows delivery to recipients whose suppressions explicitly

  • inline_css (Boolean) (defaults to: nil)
  • metadata (Hash{Symbol=>Object}) (defaults to: nil)

    Custom metadata. Write-only; not returned in responses.

  • reply_to (String, Telnyx::Models::EmailInboxes::EmailAddress) (defaults to: nil)

    Reply-to address. If provided as an object with a name, only the email is stored

  • sandbox_mode (Boolean) (defaults to: nil)
  • scheduled_at (Time, nil) (defaults to: nil)

    Future ISO 8601 time to schedule sending. Invalid or past timestamps

  • send_at (Time) (defaults to: nil)

    Deprecated alias for scheduled_at.

  • subject (String) (defaults to: nil)

    Required unless template_id is supplied. When using a template, the template's

  • tags (Array<String>) (defaults to: nil)

    Tags for categorization and reporting. Stored on the message and propagated to E

  • template_id (String) (defaults to: nil)
  • template_variables (Hash{Symbol=>Object}) (defaults to: nil)

    Variables for Liquid template rendering. Non-object values may cause a 422 valid

  • text_body (String) (defaults to: nil)

    Plain text email body. Returned only by GET /email_messages/{id}; omitted from

  • tracking_settings (Telnyx::Models::TrackingSettings) (defaults to: nil)

    Per-send open and click tracking overrides. Omitted properties inherit the sende



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/telnyx/models/email_message_batch_params.rb', line 39

class Message < Telnyx::Internal::Type::BaseModel
  # @!attribute from
  #
  #   @return [String, Telnyx::Models::EmailInboxes::EmailAddress]
  required :from, union: -> { Telnyx::EmailAddressInput }

  # @!attribute to
  #
  #   @return [Array<String, Telnyx::Models::EmailInboxes::EmailAddress>]
  required :to, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::EmailAddressInput] }

  # @!attribute attachments
  #
  #   @return [Array<Telnyx::Models::AttachmentRequest>, nil]
  optional :attachments, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::AttachmentRequest] }

  # @!attribute bcc
  #
  #   @return [Array<String, Telnyx::Models::EmailInboxes::EmailAddress>, nil]
  optional :bcc, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::EmailAddressInput] }

  # @!attribute cc
  #
  #   @return [Array<String, Telnyx::Models::EmailInboxes::EmailAddress>, nil]
  optional :cc, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::EmailAddressInput] }

  # @!attribute from_name
  #   Optional display name for string `from`; overrides `from.name` when provided.
  #
  #   @return [String, nil]
  optional :from_name, String

  # @!attribute group_id
  #   Optional unsubscribe-group UUID used for group-scoped suppression checks and
  #   unsubscribe handling.
  #
  #   @return [String, nil]
  optional :group_id, String, nil?: true

  # @!attribute headers
  #   Custom email headers. Write-only; not returned in responses.
  #
  #   @return [Hash{Symbol=>String}, nil]
  optional :headers, Telnyx::Internal::Type::HashOf[String]

  # @!attribute html_body
  #   HTML email body. Returned only by `GET /email_messages/{id}`; omitted from
  #   create and list responses.
  #
  #   @return [String, nil]
  optional :html_body, String

  # @!attribute ignore_suppression
  #   When true, allows delivery to recipients whose suppressions explicitly permit an
  #   override. Hard bounces, spam complaints, and invalid-address suppressions cannot
  #   be overridden. Requires the `email:override` API scope.
  #
  #   @return [Boolean, nil]
  optional :ignore_suppression, Telnyx::Internal::Type::Boolean

  # @!attribute inline_css
  #
  #   @return [Boolean, nil]
  optional :inline_css, Telnyx::Internal::Type::Boolean

  # @!attribute metadata
  #   Custom metadata. Write-only; not returned in responses.
  #
  #   @return [Hash{Symbol=>Object}, nil]
  optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

  # @!attribute reply_to
  #   Reply-to address. If provided as an object with a name, only the email is
  #   stored; the name is ignored.
  #
  #   @return [String, Telnyx::Models::EmailInboxes::EmailAddress, nil]
  optional :reply_to, union: -> { Telnyx::EmailAddressInput }

  # @!attribute sandbox_mode
  #
  #   @return [Boolean, nil]
  optional :sandbox_mode, Telnyx::Internal::Type::Boolean

  # @!attribute scheduled_at
  #   Future ISO 8601 time to schedule sending. Invalid or past timestamps are
  #   silently ignored and the email is sent immediately. The legacy alias `send_at`
  #   is still accepted for backward compatibility; when both are provided,
  #   `scheduled_at` wins.
  #
  #   @return [Time, nil]
  optional :scheduled_at, Time, nil?: true

  # @!attribute send_at
  #   @deprecated
  #
  #   Deprecated alias for `scheduled_at`.
  #
  #   @return [Time, nil]
  optional :send_at, Time

  # @!attribute subject
  #   Required unless `template_id` is supplied. When using a template, the template's
  #   subject is rendered; if the template has no subject or renders empty, the
  #   request returns 400.
  #
  #   @return [String, nil]
  optional :subject, String

  # @!attribute tags
  #   Tags for categorization and reporting. Stored on the message and propagated to
  #   Email Detail Records. Not returned in API responses.
  #
  #   @return [Array<String>, nil]
  optional :tags, Telnyx::Internal::Type::ArrayOf[String]

  # @!attribute template_id
  #
  #   @return [String, nil]
  optional :template_id, String

  # @!attribute template_variables
  #   Variables for Liquid template rendering. Non-object values may cause a 422
  #   validation error on message creation, but are silently treated as an empty
  #   object for template rendering.
  #
  #   @return [Hash{Symbol=>Object}, nil]
  optional :template_variables, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

  # @!attribute text_body
  #   Plain text email body. Returned only by `GET /email_messages/{id}`; omitted from
  #   create and list responses.
  #
  #   @return [String, nil]
  optional :text_body, String

  # @!attribute tracking_settings
  #   Per-send open and click tracking overrides. Omitted properties inherit the
  #   sender domain's tracking settings.
  #
  #   @return [Telnyx::Models::TrackingSettings, nil]
  optional :tracking_settings, -> { Telnyx::TrackingSettings }

  # @!method initialize(from:, to:, attachments: nil, bcc: nil, cc: nil, from_name: nil, group_id: nil, headers: nil, html_body: nil, ignore_suppression: nil, inline_css: nil, metadata: nil, reply_to: nil, sandbox_mode: nil, scheduled_at: nil, send_at: nil, subject: nil, tags: nil, template_id: nil, template_variables: nil, text_body: nil, tracking_settings: nil)
  #   Some parameter documentations has been truncated, see
  #   {Telnyx::Models::EmailMessageBatchParams::Message} for more details.
  #
  #   A single message in a batch create request. This schema mirrors
  #   `CreateEmailRequest` EXCEPT it does not accept the reply/forward threading
  #   parameters (`in_reply_to_message_id`, `reply_to_all`, `forward_of_message_id`) —
  #   those are single-send-only in Phase 1 (MSG-1491) and are not yet implemented on
  #   the batch endpoint. Recipient email addresses must be unique across `to`, `cc`,
  #   and `bcc` after case-insensitive normalization. Duplicate recipients return
  #   `400`.
  #
  #   @param from [String, Telnyx::Models::EmailInboxes::EmailAddress]
  #
  #   @param to [Array<String, Telnyx::Models::EmailInboxes::EmailAddress>]
  #
  #   @param attachments [Array<Telnyx::Models::AttachmentRequest>]
  #
  #   @param bcc [Array<String, Telnyx::Models::EmailInboxes::EmailAddress>]
  #
  #   @param cc [Array<String, Telnyx::Models::EmailInboxes::EmailAddress>]
  #
  #   @param from_name [String] Optional display name for string `from`; overrides `from.name` when provided.
  #
  #   @param group_id [String, nil] Optional unsubscribe-group UUID used for group-scoped suppression checks and uns
  #
  #   @param headers [Hash{Symbol=>String}] Custom email headers. Write-only; not returned in responses.
  #
  #   @param html_body [String] HTML email body. Returned only by `GET /email_messages/{id}`; omitted from creat
  #
  #   @param ignore_suppression [Boolean] When true, allows delivery to recipients whose suppressions explicitly
  #
  #   @param inline_css [Boolean]
  #
  #   @param metadata [Hash{Symbol=>Object}] Custom metadata. Write-only; not returned in responses.
  #
  #   @param reply_to [String, Telnyx::Models::EmailInboxes::EmailAddress] Reply-to address. If provided as an object with a name, only the email is stored
  #
  #   @param sandbox_mode [Boolean]
  #
  #   @param scheduled_at [Time, nil] Future ISO 8601 time to schedule sending. Invalid or past timestamps
  #
  #   @param send_at [Time] Deprecated alias for `scheduled_at`.
  #
  #   @param subject [String] Required unless `template_id` is supplied. When using a template, the template's
  #
  #   @param tags [Array<String>] Tags for categorization and reporting. Stored on the message and propagated to E
  #
  #   @param template_id [String]
  #
  #   @param template_variables [Hash{Symbol=>Object}] Variables for Liquid template rendering. Non-object values may cause a 422 valid
  #
  #   @param text_body [String] Plain text email body. Returned only by `GET /email_messages/{id}`; omitted from
  #
  #   @param tracking_settings [Telnyx::Models::TrackingSettings] Per-send open and click tracking overrides. Omitted properties inherit the sende
end

Instance Attribute Details

#attachmentsArray<Telnyx::Models::AttachmentRequest>?

Returns:



53
# File 'lib/telnyx/models/email_message_batch_params.rb', line 53

optional :attachments, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::AttachmentRequest] }

#bccArray<String, Telnyx::Models::EmailInboxes::EmailAddress>?

Returns:



58
# File 'lib/telnyx/models/email_message_batch_params.rb', line 58

optional :bcc, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::EmailAddressInput] }

#ccArray<String, Telnyx::Models::EmailInboxes::EmailAddress>?

Returns:



63
# File 'lib/telnyx/models/email_message_batch_params.rb', line 63

optional :cc, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::EmailAddressInput] }

#fromString, Telnyx::Models::EmailInboxes::EmailAddress

Parameters:

  • value (Telnyx::Models::email_address_input)

Returns:



43
# File 'lib/telnyx/models/email_message_batch_params.rb', line 43

required :from, union: -> { Telnyx::EmailAddressInput }

#from_nameString?

Optional display name for string from; overrides from.name when provided.

Parameters:

  • (String)

Returns:

  • (String, nil)


69
# File 'lib/telnyx/models/email_message_batch_params.rb', line 69

optional :from_name, String

#group_idString?

Optional unsubscribe-group UUID used for group-scoped suppression checks and unsubscribe handling.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


76
# File 'lib/telnyx/models/email_message_batch_params.rb', line 76

optional :group_id, String, nil?: true

#headersHash{Symbol=>String}?

Custom email headers. Write-only; not returned in responses.

Parameters:

  • (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String}, nil)


82
# File 'lib/telnyx/models/email_message_batch_params.rb', line 82

optional :headers, Telnyx::Internal::Type::HashOf[String]

#html_bodyString?

HTML email body. Returned only by GET /email_messages/{id}; omitted from create and list responses.

Parameters:

  • (String)

Returns:

  • (String, nil)


89
# File 'lib/telnyx/models/email_message_batch_params.rb', line 89

optional :html_body, String

#ignore_suppressionBoolean?

When true, allows delivery to recipients whose suppressions explicitly permit an override. Hard bounces, spam complaints, and invalid-address suppressions cannot be overridden. Requires the email:override API scope.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


97
# File 'lib/telnyx/models/email_message_batch_params.rb', line 97

optional :ignore_suppression, Telnyx::Internal::Type::Boolean

#inline_cssBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


102
# File 'lib/telnyx/models/email_message_batch_params.rb', line 102

optional :inline_css, Telnyx::Internal::Type::Boolean

#metadataHash{Symbol=>Object}?

Custom metadata. Write-only; not returned in responses.

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


108
# File 'lib/telnyx/models/email_message_batch_params.rb', line 108

optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

#reply_toString, ...

Reply-to address. If provided as an object with a name, only the email is stored; the name is ignored.



115
# File 'lib/telnyx/models/email_message_batch_params.rb', line 115

optional :reply_to, union: -> { Telnyx::EmailAddressInput }

#sandbox_modeBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


120
# File 'lib/telnyx/models/email_message_batch_params.rb', line 120

optional :sandbox_mode, Telnyx::Internal::Type::Boolean

#scheduled_atTime?

Future ISO 8601 time to schedule sending. Invalid or past timestamps are silently ignored and the email is sent immediately. The legacy alias send_at is still accepted for backward compatibility; when both are provided, scheduled_at wins.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


129
# File 'lib/telnyx/models/email_message_batch_params.rb', line 129

optional :scheduled_at, Time, nil?: true

#send_atTime?

Deprecated.

Deprecated alias for scheduled_at.

Parameters:

  • (Time)

Returns:

  • (Time, nil)


137
# File 'lib/telnyx/models/email_message_batch_params.rb', line 137

optional :send_at, Time

#subjectString?

Required unless template_id is supplied. When using a template, the template's subject is rendered; if the template has no subject or renders empty, the request returns 400.

Parameters:

  • (String)

Returns:

  • (String, nil)


145
# File 'lib/telnyx/models/email_message_batch_params.rb', line 145

optional :subject, String

#tagsArray<String>?

Tags for categorization and reporting. Stored on the message and propagated to Email Detail Records. Not returned in API responses.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


152
# File 'lib/telnyx/models/email_message_batch_params.rb', line 152

optional :tags, Telnyx::Internal::Type::ArrayOf[String]

#template_idString?

Parameters:

  • (String)

Returns:

  • (String, nil)


157
# File 'lib/telnyx/models/email_message_batch_params.rb', line 157

optional :template_id, String

#template_variablesHash{Symbol=>Object}?

Variables for Liquid template rendering. Non-object values may cause a 422 validation error on message creation, but are silently treated as an empty object for template rendering.

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


165
# File 'lib/telnyx/models/email_message_batch_params.rb', line 165

optional :template_variables, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

#text_bodyString?

Plain text email body. Returned only by GET /email_messages/{id}; omitted from create and list responses.

Parameters:

  • (String)

Returns:

  • (String, nil)


172
# File 'lib/telnyx/models/email_message_batch_params.rb', line 172

optional :text_body, String

#toArray<String, Telnyx::Models::EmailInboxes::EmailAddress>

Parameters:

  • value (::Array[Telnyx::Models::email_address_input])

Returns:



48
# File 'lib/telnyx/models/email_message_batch_params.rb', line 48

required :to, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::EmailAddressInput] }

#tracking_settingsTelnyx::Models::TrackingSettings?

Per-send open and click tracking overrides. Omitted properties inherit the sender domain's tracking settings.



179
# File 'lib/telnyx/models/email_message_batch_params.rb', line 179

optional :tracking_settings, -> { Telnyx::TrackingSettings }

Instance Method Details

#to_hash{

Returns:

  • ({)


181
# File 'sig/telnyx/models/email_message_batch_params.rbs', line 181

def to_hash: -> {