@wix/auto_sdk_email-transmissions_email-transmissions 1.0.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.
Files changed (52) hide show
  1. package/build/cjs/index.d.ts +46 -0
  2. package/build/cjs/index.js +488 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +744 -0
  5. package/build/cjs/index.typings.js +434 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +551 -0
  8. package/build/cjs/meta.js +343 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/schemas.d.ts +423 -0
  11. package/build/cjs/schemas.js +748 -0
  12. package/build/cjs/schemas.js.map +1 -0
  13. package/build/es/index.d.mts +46 -0
  14. package/build/es/index.mjs +454 -0
  15. package/build/es/index.mjs.map +1 -0
  16. package/build/es/index.typings.d.mts +744 -0
  17. package/build/es/index.typings.mjs +399 -0
  18. package/build/es/index.typings.mjs.map +1 -0
  19. package/build/es/meta.d.mts +551 -0
  20. package/build/es/meta.mjs +307 -0
  21. package/build/es/meta.mjs.map +1 -0
  22. package/build/es/package.json +3 -0
  23. package/build/es/schemas.d.mts +423 -0
  24. package/build/es/schemas.mjs +704 -0
  25. package/build/es/schemas.mjs.map +1 -0
  26. package/build/internal/cjs/index.d.ts +46 -0
  27. package/build/internal/cjs/index.js +488 -0
  28. package/build/internal/cjs/index.js.map +1 -0
  29. package/build/internal/cjs/index.typings.d.ts +744 -0
  30. package/build/internal/cjs/index.typings.js +434 -0
  31. package/build/internal/cjs/index.typings.js.map +1 -0
  32. package/build/internal/cjs/meta.d.ts +551 -0
  33. package/build/internal/cjs/meta.js +343 -0
  34. package/build/internal/cjs/meta.js.map +1 -0
  35. package/build/internal/cjs/schemas.d.ts +423 -0
  36. package/build/internal/cjs/schemas.js +748 -0
  37. package/build/internal/cjs/schemas.js.map +1 -0
  38. package/build/internal/es/index.d.mts +46 -0
  39. package/build/internal/es/index.mjs +454 -0
  40. package/build/internal/es/index.mjs.map +1 -0
  41. package/build/internal/es/index.typings.d.mts +744 -0
  42. package/build/internal/es/index.typings.mjs +399 -0
  43. package/build/internal/es/index.typings.mjs.map +1 -0
  44. package/build/internal/es/meta.d.mts +551 -0
  45. package/build/internal/es/meta.mjs +307 -0
  46. package/build/internal/es/meta.mjs.map +1 -0
  47. package/build/internal/es/schemas.d.mts +423 -0
  48. package/build/internal/es/schemas.mjs +704 -0
  49. package/build/internal/es/schemas.mjs.map +1 -0
  50. package/meta/package.json +3 -0
  51. package/package.json +61 -0
  52. package/schemas/package.json +3 -0
@@ -0,0 +1,744 @@
1
+ import * as _wix_sdk_types from '@wix/sdk-types';
2
+ import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
3
+
4
+ /**
5
+ * An EmailTransmission is entity used for sending emails.
6
+ * Creating an entity of this type will trigger an email to be sent to the specified recipients.
7
+ * The email will be sent asynchronously, and the status of the transmission can be tracked using the EmailTransmission entity.
8
+ */
9
+ interface EmailTransmission extends EmailTransmissionTypeOptionsOneOf, EmailTransmissionStatusOptionsOneOf {
10
+ /** Options for marketing email. */
11
+ marketingOptions?: MarketingOptions;
12
+ /**
13
+ * Options for rejected email transmission.
14
+ * @readonly
15
+ */
16
+ rejectedOptions?: RejectedOptions;
17
+ /**
18
+ * EmailTransmission ID.
19
+ * @format GUID
20
+ * @readonly
21
+ */
22
+ _id?: string;
23
+ /**
24
+ * Date and time the EmailTransmission was created.
25
+ * @readonly
26
+ */
27
+ _createdDate?: Date | null;
28
+ /**
29
+ * Date and time the EmailTransmission was last updated.
30
+ * @readonly
31
+ */
32
+ _updatedDate?: Date | null;
33
+ /**
34
+ * Revision number, which increments by 1 each time the EmailTransmission is updated.
35
+ * @readonly
36
+ */
37
+ revision?: string | null;
38
+ /**
39
+ * Email subject (optional). Default - empty.
40
+ * @maxLength 200
41
+ */
42
+ emailSubject?: string | null;
43
+ /**
44
+ * Full HTML content of the email to be sent.
45
+ * Note that this field is not returned in the QueryEmailTransmissions endpoint for performance reasons. Use GetEmailTransmission to retrieve the full content of a specific email transmission.
46
+ * Important: in order to save storage space, this field will only be stored for 30 days after the email transmission is created. After that, it will be deleted and will not be retrievable anymore.
47
+ * @maxLength 1000000
48
+ */
49
+ emailHtmlContent?: string;
50
+ /**
51
+ * Request metadata (optional). Default - empty.
52
+ * Provided values will be passed to the ESP and then included in various callbacks to identify the context in which an email was sent.
53
+ * Length of each key and value must be between 1 and 50 alphanumeric characters.
54
+ * @maxSize 10
55
+ */
56
+ metadata?: Record<string, string>;
57
+ /**
58
+ * Sender name (optional). Default - empty.
59
+ * @minLength 1
60
+ * @maxLength 50
61
+ */
62
+ senderName?: string | null;
63
+ /**
64
+ * Sender email address (optional). Default - wix owned email address (for example "no-reply@wixsitemail.com").
65
+ * If provided sender email address is unauthenticated and cannot be used for sending emails (for example gmail.com), it will be replaced with wix owned email address.
66
+ * In that case provided email address will be used as reply-to unless reply-to email address is provided explicitly.
67
+ * @format EMAIL
68
+ */
69
+ senderEmailAddress?: string | null;
70
+ /** Recipient to whom replies will be sent (optional). Default - empty (which effectively resolves to "sender_email_address"). */
71
+ replyTo?: Recipient;
72
+ /**
73
+ * Recipients to whom the email will be sent.
74
+ * @minSize 1
75
+ * @maxSize 100
76
+ */
77
+ toRecipients?: Recipient[];
78
+ /** Email type - transactional or marketing. */
79
+ type?: TypeWithLiterals;
80
+ /**
81
+ * Email transmission status.
82
+ * @readonly
83
+ */
84
+ status?: StatusWithLiterals;
85
+ }
86
+ /** @oneof */
87
+ interface EmailTransmissionTypeOptionsOneOf {
88
+ /** Options for marketing email. */
89
+ marketingOptions?: MarketingOptions;
90
+ }
91
+ /** @oneof */
92
+ interface EmailTransmissionStatusOptionsOneOf {
93
+ /**
94
+ * Options for rejected email transmission.
95
+ * @readonly
96
+ */
97
+ rejectedOptions?: RejectedOptions;
98
+ }
99
+ interface Recipient extends RecipientValueOneOf {
100
+ /**
101
+ * Recipient email address will be resolved from Contacts API.
102
+ * @format GUID
103
+ */
104
+ contactId?: string;
105
+ /**
106
+ * Recipient email address will be resolved from Users API.
107
+ * @format GUID
108
+ */
109
+ userId?: string;
110
+ /**
111
+ * Contact will be created with this email address if it does not exist yet.
112
+ * @format EMAIL
113
+ */
114
+ emailAddress?: string;
115
+ /**
116
+ * Recipient name (optional). Default - empty.
117
+ * @minLength 1
118
+ * @maxLength 50
119
+ */
120
+ name?: string | null;
121
+ /**
122
+ * Failure reason - filled if the recipient was skipped and the email was not sent to them. Otherwise, it will be NONE.
123
+ * @readonly
124
+ */
125
+ failureReason?: FailureReasonWithLiterals;
126
+ }
127
+ /** @oneof */
128
+ interface RecipientValueOneOf {
129
+ /**
130
+ * Recipient email address will be resolved from Contacts API.
131
+ * @format GUID
132
+ */
133
+ contactId?: string;
134
+ /**
135
+ * Recipient email address will be resolved from Users API.
136
+ * @format GUID
137
+ */
138
+ userId?: string;
139
+ /**
140
+ * Contact will be created with this email address if it does not exist yet.
141
+ * @format EMAIL
142
+ */
143
+ emailAddress?: string;
144
+ }
145
+ declare enum FailureReason {
146
+ /** Present in case of successfully sent email. */
147
+ NONE = "NONE",
148
+ /** Contact or user not found by given ID. */
149
+ RECIPIENT_NOT_FOUND = "RECIPIENT_NOT_FOUND",
150
+ /** Contact or user has empty email address. */
151
+ EMAIL_ADDRESS_MISSING = "EMAIL_ADDRESS_MISSING",
152
+ /** Email address is invalid (no such mailbox exist). */
153
+ EMAIL_ADDRESS_INVALID = "EMAIL_ADDRESS_INVALID",
154
+ /** Email address has bounced previously and cannot be sent to again. */
155
+ EMAIL_ADDRESS_BOUNCED = "EMAIL_ADDRESS_BOUNCED",
156
+ /** Recipient did not give consent to send marketing emails. */
157
+ MARKETING_CONSENT_NOT_GIVEN = "MARKETING_CONSENT_NOT_GIVEN",
158
+ /** User is currently not a collaborator on the site. */
159
+ NOT_SITE_COLLABORATOR = "NOT_SITE_COLLABORATOR"
160
+ }
161
+ /** @enumType */
162
+ type FailureReasonWithLiterals = FailureReason | 'NONE' | 'RECIPIENT_NOT_FOUND' | 'EMAIL_ADDRESS_MISSING' | 'EMAIL_ADDRESS_INVALID' | 'EMAIL_ADDRESS_BOUNCED' | 'MARKETING_CONSENT_NOT_GIVEN' | 'NOT_SITE_COLLABORATOR';
163
+ declare enum Type {
164
+ /** Email is mostly sent to a single recipient in response to an action they took. No unsubscribe link is added to the email. */
165
+ TRANSACTIONAL = "TRANSACTIONAL",
166
+ /** Email is sent to multiple recipients, usually as part of a marketing campaign. Unsubscribe link is added to the email. */
167
+ MARKETING = "MARKETING"
168
+ }
169
+ /** @enumType */
170
+ type TypeWithLiterals = Type | 'TRANSACTIONAL' | 'MARKETING';
171
+ interface MarketingOptions {
172
+ /**
173
+ * Placeholder that will be replaced with the actual unsubscribe URL in the email content (optional, case sensitive).
174
+ * Make sure it's unique and not used anywhere else in the email content.
175
+ * For example, you can use a placeholder like {{unsubscribe_url}} or [UNSUBSCRIBE_URL].
176
+ * If it's not provided, then unsubscribe URL (in site main language) text will be added to the bottom of the email.
177
+ * @maxLength 100
178
+ */
179
+ unsubscribeUrlPlaceholder?: string | null;
180
+ }
181
+ declare enum Status {
182
+ /** Email transmission has been successfully created (and will be processed shortly). */
183
+ ACCEPTED = "ACCEPTED",
184
+ /** Email transmission is currently being processed (checking content, resolving recipients, sending emails). */
185
+ IN_PROGRESS = "IN_PROGRESS",
186
+ /** Email transmission has been fully processed (per recipient information is now available). */
187
+ PROCESSED = "PROCESSED",
188
+ /** Email transmission failed abuse check and no emails will be sent. */
189
+ REJECTED = "REJECTED"
190
+ }
191
+ /** @enumType */
192
+ type StatusWithLiterals = Status | 'ACCEPTED' | 'IN_PROGRESS' | 'PROCESSED' | 'REJECTED';
193
+ interface RejectedOptions {
194
+ /**
195
+ * Reasons for email transmission rejection.
196
+ * @minSize 1
197
+ * @maxSize 10
198
+ * @readonly
199
+ */
200
+ rejectionReasons?: RejectionReasonWithLiterals[];
201
+ }
202
+ declare enum RejectionReason {
203
+ BLACKLISTED_SENDER_EMAIL = "BLACKLISTED_SENDER_EMAIL",
204
+ BLACKLISTED_SENDER_NAME = "BLACKLISTED_SENDER_NAME",
205
+ BLACKLISTED_REPLY_TO_EMAIL = "BLACKLISTED_REPLY_TO_EMAIL",
206
+ BLACKLISTED_REPLY_TO_NAME = "BLACKLISTED_REPLY_TO_NAME",
207
+ BLACKLISTED_LINK = "BLACKLISTED_LINK",
208
+ BLACKLISTED_TEXT = "BLACKLISTED_TEXT"
209
+ }
210
+ /** @enumType */
211
+ type RejectionReasonWithLiterals = RejectionReason | 'BLACKLISTED_SENDER_EMAIL' | 'BLACKLISTED_SENDER_NAME' | 'BLACKLISTED_REPLY_TO_EMAIL' | 'BLACKLISTED_REPLY_TO_NAME' | 'BLACKLISTED_LINK' | 'BLACKLISTED_TEXT';
212
+ interface SendEmailTransmissionRequest {
213
+ /** EmailTransmission to be created. */
214
+ emailTransmission: EmailTransmission;
215
+ /**
216
+ * Idempotency key used to prevent duplicate email transmissions (optional).
217
+ * If a request with the same idempotency key is received, the server will return the same response as the original request.
218
+ * @format GUID
219
+ */
220
+ idempotencyKey?: string | null;
221
+ }
222
+ interface SendEmailTransmissionResponse {
223
+ /** The created EmailTransmission. */
224
+ emailTransmission?: EmailTransmission;
225
+ }
226
+ interface AccountSuspendedErrorDetails {
227
+ /**
228
+ * URL of the page where the user can contact support or learn more about the suspension.
229
+ * @format WEB_URL
230
+ */
231
+ termsOfServicePageUrl?: string;
232
+ }
233
+ interface OutOfQuotaErrorDetails {
234
+ /**
235
+ * URL of the page where the user can upgrade their plan or purchase more quota.
236
+ * @format WEB_URL
237
+ */
238
+ packagePickerUrl?: string;
239
+ }
240
+ interface GetEmailTransmissionRequest {
241
+ /**
242
+ * ID of the EmailTransmission to retrieve.
243
+ * @format GUID
244
+ */
245
+ emailTransmissionId: string;
246
+ }
247
+ interface GetEmailTransmissionResponse {
248
+ /** The requested EmailTransmission. */
249
+ emailTransmission?: EmailTransmission;
250
+ }
251
+ interface QueryEmailTransmissionsRequest {
252
+ /** WQL expression. */
253
+ query?: CursorQuery;
254
+ }
255
+ interface CursorQuery extends CursorQueryPagingMethodOneOf {
256
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
257
+ cursorPaging?: CursorPaging;
258
+ /**
259
+ * Filter object in the following format:
260
+ * `"filter" : {
261
+ * "fieldName1": "value1",
262
+ * "fieldName2":{"$operator":"value2"}
263
+ * }`
264
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
265
+ */
266
+ filter?: Record<string, any> | null;
267
+ /**
268
+ * Sort object in the following format:
269
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
270
+ * @maxSize 4
271
+ */
272
+ sort?: Sorting[];
273
+ }
274
+ /** @oneof */
275
+ interface CursorQueryPagingMethodOneOf {
276
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
277
+ cursorPaging?: CursorPaging;
278
+ }
279
+ interface Sorting {
280
+ /**
281
+ * Name of the field to sort by.
282
+ * @minLength 1
283
+ * @maxLength 50
284
+ */
285
+ fieldName?: string;
286
+ /** Sort order. */
287
+ order?: SortOrderWithLiterals;
288
+ }
289
+ declare enum SortOrder {
290
+ ASC = "ASC",
291
+ DESC = "DESC"
292
+ }
293
+ /** @enumType */
294
+ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
295
+ interface CursorPaging {
296
+ /**
297
+ * Number of items to load.
298
+ * @max 100
299
+ */
300
+ limit?: number | null;
301
+ /**
302
+ * Pointer to the next or previous page in the list of results.
303
+ *
304
+ * You can get the relevant cursor token
305
+ * from the `pagingMetadata` object in the previous call's response.
306
+ * Not relevant for the first request.
307
+ * @maxLength 1000
308
+ */
309
+ cursor?: string | null;
310
+ }
311
+ interface QueryEmailTransmissionsResponse {
312
+ /** List of EmailTransmissions. */
313
+ emailTransmissions?: EmailTransmission[];
314
+ /** Paging metadata */
315
+ pagingMetadata?: CursorPagingMetadata;
316
+ }
317
+ interface CursorPagingMetadata {
318
+ /** Number of items returned in the response. */
319
+ count?: number | null;
320
+ /** Offset that was requested. */
321
+ cursors?: Cursors;
322
+ /**
323
+ * Indicates if there are more results after the current page.
324
+ * If `true`, another page of results can be retrieved.
325
+ * If `false`, this is the last page.
326
+ */
327
+ hasNext?: boolean | null;
328
+ }
329
+ interface Cursors {
330
+ /**
331
+ * Cursor pointing to next page in the list of results.
332
+ * @maxLength 1000
333
+ */
334
+ next?: string | null;
335
+ /**
336
+ * Cursor pointing to previous page in the list of results.
337
+ * @maxLength 1000
338
+ */
339
+ prev?: string | null;
340
+ }
341
+ interface DeleteEmailTransmissionRequest {
342
+ /**
343
+ * Id of the EmailTransmission to delete.
344
+ * @format GUID
345
+ */
346
+ emailTransmissionId: string;
347
+ }
348
+ interface DeleteEmailTransmissionResponse {
349
+ }
350
+ interface DomainEvent extends DomainEventBodyOneOf {
351
+ createdEvent?: EntityCreatedEvent;
352
+ updatedEvent?: EntityUpdatedEvent;
353
+ deletedEvent?: EntityDeletedEvent;
354
+ actionEvent?: ActionEvent;
355
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
356
+ _id?: string;
357
+ /**
358
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
359
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
360
+ */
361
+ entityFqdn?: string;
362
+ /**
363
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
364
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
365
+ */
366
+ slug?: string;
367
+ /** ID of the entity associated with the event. */
368
+ entityId?: string;
369
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
370
+ eventTime?: Date | null;
371
+ /**
372
+ * Whether the event was triggered as a result of a privacy regulation application
373
+ * (for example, GDPR).
374
+ */
375
+ triggeredByAnonymizeRequest?: boolean | null;
376
+ /** If present, indicates the action that triggered the event. */
377
+ originatedFrom?: string | null;
378
+ /**
379
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
380
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
381
+ */
382
+ entityEventSequence?: string | null;
383
+ }
384
+ /** @oneof */
385
+ interface DomainEventBodyOneOf {
386
+ createdEvent?: EntityCreatedEvent;
387
+ updatedEvent?: EntityUpdatedEvent;
388
+ deletedEvent?: EntityDeletedEvent;
389
+ actionEvent?: ActionEvent;
390
+ }
391
+ interface EntityCreatedEvent {
392
+ entity?: string;
393
+ }
394
+ interface RestoreInfo {
395
+ deletedDate?: Date | null;
396
+ }
397
+ interface EntityUpdatedEvent {
398
+ /**
399
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
400
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
401
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
402
+ */
403
+ currentEntity?: string;
404
+ }
405
+ interface EntityDeletedEvent {
406
+ /** Entity that was deleted. */
407
+ deletedEntity?: string | null;
408
+ }
409
+ interface ActionEvent {
410
+ body?: string;
411
+ }
412
+ interface Empty {
413
+ }
414
+ interface MessageEnvelope {
415
+ /**
416
+ * App instance ID.
417
+ * @format GUID
418
+ */
419
+ instanceId?: string | null;
420
+ /**
421
+ * Event type.
422
+ * @maxLength 150
423
+ */
424
+ eventType?: string;
425
+ /** The identification type and identity data. */
426
+ identity?: IdentificationData;
427
+ /** Stringify payload. */
428
+ data?: string;
429
+ /** Details related to the account */
430
+ accountInfo?: AccountInfo;
431
+ }
432
+ interface IdentificationData extends IdentificationDataIdOneOf {
433
+ /**
434
+ * ID of a site visitor that has not logged in to the site.
435
+ * @format GUID
436
+ */
437
+ anonymousVisitorId?: string;
438
+ /**
439
+ * ID of a site visitor that has logged in to the site.
440
+ * @format GUID
441
+ */
442
+ memberId?: string;
443
+ /**
444
+ * ID of a Wix user (site owner, contributor, etc.).
445
+ * @format GUID
446
+ */
447
+ wixUserId?: string;
448
+ /**
449
+ * ID of an app.
450
+ * @format GUID
451
+ */
452
+ appId?: string;
453
+ /** @readonly */
454
+ identityType?: WebhookIdentityTypeWithLiterals;
455
+ }
456
+ /** @oneof */
457
+ interface IdentificationDataIdOneOf {
458
+ /**
459
+ * ID of a site visitor that has not logged in to the site.
460
+ * @format GUID
461
+ */
462
+ anonymousVisitorId?: string;
463
+ /**
464
+ * ID of a site visitor that has logged in to the site.
465
+ * @format GUID
466
+ */
467
+ memberId?: string;
468
+ /**
469
+ * ID of a Wix user (site owner, contributor, etc.).
470
+ * @format GUID
471
+ */
472
+ wixUserId?: string;
473
+ /**
474
+ * ID of an app.
475
+ * @format GUID
476
+ */
477
+ appId?: string;
478
+ }
479
+ declare enum WebhookIdentityType {
480
+ UNKNOWN = "UNKNOWN",
481
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
482
+ MEMBER = "MEMBER",
483
+ WIX_USER = "WIX_USER",
484
+ APP = "APP"
485
+ }
486
+ /** @enumType */
487
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
488
+ interface AccountInfo {
489
+ /**
490
+ * ID of the Wix account associated with the event.
491
+ * @format GUID
492
+ */
493
+ accountId?: string | null;
494
+ /**
495
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
496
+ * @format GUID
497
+ */
498
+ parentAccountId?: string | null;
499
+ /**
500
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
501
+ * @format GUID
502
+ */
503
+ siteId?: string | null;
504
+ }
505
+ /** @docsIgnore */
506
+ type SendEmailTransmissionApplicationErrors = {
507
+ code?: 'ACCOUNT_SUSPENDED';
508
+ description?: string;
509
+ data?: AccountSuspendedErrorDetails;
510
+ } | {
511
+ code?: 'UNVERIFIED_SENDER_EMAIL';
512
+ description?: string;
513
+ data?: Record<string, any>;
514
+ } | {
515
+ code?: 'OUT_OF_QUOTA';
516
+ description?: string;
517
+ data?: OutOfQuotaErrorDetails;
518
+ };
519
+ /** @docsIgnore */
520
+ type SendEmailTransmissionValidationErrors = {
521
+ ruleName?: 'INVALID_METADATA';
522
+ };
523
+ /** @docsIgnore */
524
+ type DeleteEmailTransmissionApplicationErrors = {
525
+ code?: 'EMAIL_TRANSMISSION_IS_IN_PROGRESS';
526
+ description?: string;
527
+ data?: Record<string, any>;
528
+ };
529
+ /**
530
+ * Create and send new email transmission.
531
+ * @param emailTransmission - EmailTransmission to be created.
532
+ * @public
533
+ * @documentationMaturity preview
534
+ * @requiredField emailTransmission
535
+ * @requiredField emailTransmission.emailHtmlContent
536
+ * @requiredField emailTransmission.toRecipients
537
+ * @requiredField emailTransmission.type
538
+ * @permissionId shoutout.manage
539
+ * @applicableIdentity APP
540
+ * @fqn wix.emails.transmissions.v1.EmailTransmissionService.SendEmailTransmission
541
+ */
542
+ declare function sendEmailTransmission(emailTransmission: NonNullablePaths<EmailTransmission, `emailHtmlContent` | `toRecipients` | `type`, 2>, options?: SendEmailTransmissionOptions): Promise<NonNullablePaths<SendEmailTransmissionResponse, `emailTransmission.rejectedOptions.rejectionReasons` | `emailTransmission._id` | `emailTransmission.emailHtmlContent` | `emailTransmission.replyTo.contactId` | `emailTransmission.replyTo.userId` | `emailTransmission.replyTo.emailAddress` | `emailTransmission.replyTo.failureReason` | `emailTransmission.toRecipients` | `emailTransmission.type` | `emailTransmission.status`, 4> & {
543
+ __applicationErrorsType?: SendEmailTransmissionApplicationErrors;
544
+ __validationErrorsType?: SendEmailTransmissionValidationErrors;
545
+ }>;
546
+ interface SendEmailTransmissionOptions {
547
+ /**
548
+ * Idempotency key used to prevent duplicate email transmissions (optional).
549
+ * If a request with the same idempotency key is received, the server will return the same response as the original request.
550
+ * @format GUID
551
+ */
552
+ idempotencyKey?: string | null;
553
+ }
554
+ /**
555
+ * Get email transmission by ID.
556
+ * @param emailTransmissionId - ID of the EmailTransmission to retrieve.
557
+ * @public
558
+ * @documentationMaturity preview
559
+ * @requiredField emailTransmissionId
560
+ * @permissionId shoutout.read
561
+ * @applicableIdentity APP
562
+ * @returns The requested EmailTransmission.
563
+ * @fqn wix.emails.transmissions.v1.EmailTransmissionService.GetEmailTransmission
564
+ */
565
+ declare function getEmailTransmission(emailTransmissionId: string): Promise<NonNullablePaths<EmailTransmission, `rejectedOptions.rejectionReasons` | `_id` | `emailHtmlContent` | `replyTo.contactId` | `replyTo.userId` | `replyTo.emailAddress` | `replyTo.failureReason` | `toRecipients` | `type` | `status`, 3>>;
566
+ /**
567
+ * Query email transmissions.
568
+ * Note that field "email_html_content" is not returned in this endpoint for performance reasons. Use GetEmailTransmission to retrieve the full content of a specific email transmission.
569
+ * @public
570
+ * @documentationMaturity preview
571
+ * @permissionId shoutout.read
572
+ * @applicableIdentity APP
573
+ * @fqn wix.emails.transmissions.v1.EmailTransmissionService.QueryEmailTransmissions
574
+ */
575
+ declare function queryEmailTransmissions(): EmailTransmissionsQueryBuilder;
576
+ interface QueryCursorResult {
577
+ cursors: Cursors;
578
+ hasNext: () => boolean;
579
+ hasPrev: () => boolean;
580
+ length: number;
581
+ pageSize: number;
582
+ }
583
+ interface EmailTransmissionsQueryResult extends QueryCursorResult {
584
+ items: EmailTransmission[];
585
+ query: EmailTransmissionsQueryBuilder;
586
+ next: () => Promise<EmailTransmissionsQueryResult>;
587
+ prev: () => Promise<EmailTransmissionsQueryResult>;
588
+ }
589
+ interface EmailTransmissionsQueryBuilder {
590
+ /** @param propertyName - Property whose value is compared with `value`.
591
+ * @param value - Value to compare against.
592
+ * @documentationMaturity preview
593
+ */
594
+ eq: (propertyName: '_id' | '_updatedDate' | 'emailSubject' | 'type' | 'status', value: any) => EmailTransmissionsQueryBuilder;
595
+ /** @param propertyName - Property whose value is compared with `value`.
596
+ * @param value - Value to compare against.
597
+ * @documentationMaturity preview
598
+ */
599
+ ne: (propertyName: '_id' | '_updatedDate' | 'emailSubject' | 'type' | 'status', value: any) => EmailTransmissionsQueryBuilder;
600
+ /** @param propertyName - Property whose value is compared with `value`.
601
+ * @param value - Value to compare against.
602
+ * @documentationMaturity preview
603
+ */
604
+ ge: (propertyName: '_updatedDate' | 'emailSubject', value: any) => EmailTransmissionsQueryBuilder;
605
+ /** @param propertyName - Property whose value is compared with `value`.
606
+ * @param value - Value to compare against.
607
+ * @documentationMaturity preview
608
+ */
609
+ gt: (propertyName: '_updatedDate' | 'emailSubject', value: any) => EmailTransmissionsQueryBuilder;
610
+ /** @param propertyName - Property whose value is compared with `value`.
611
+ * @param value - Value to compare against.
612
+ * @documentationMaturity preview
613
+ */
614
+ le: (propertyName: '_updatedDate' | 'emailSubject', value: any) => EmailTransmissionsQueryBuilder;
615
+ /** @param propertyName - Property whose value is compared with `value`.
616
+ * @param value - Value to compare against.
617
+ * @documentationMaturity preview
618
+ */
619
+ lt: (propertyName: '_updatedDate' | 'emailSubject', value: any) => EmailTransmissionsQueryBuilder;
620
+ /** @param propertyName - Property whose value is compared with `string`.
621
+ * @param string - String to compare against. Case-insensitive.
622
+ * @documentationMaturity preview
623
+ */
624
+ startsWith: (propertyName: 'emailSubject', value: string) => EmailTransmissionsQueryBuilder;
625
+ /** @param propertyName - Property whose value is compared with `values`.
626
+ * @param values - List of values to compare against.
627
+ * @documentationMaturity preview
628
+ */
629
+ hasSome: (propertyName: '_updatedDate' | 'emailSubject', value: any[]) => EmailTransmissionsQueryBuilder;
630
+ /** @documentationMaturity preview */
631
+ in: (propertyName: '_id' | '_updatedDate' | 'emailSubject' | 'type' | 'status', value: any) => EmailTransmissionsQueryBuilder;
632
+ /** @documentationMaturity preview */
633
+ exists: (propertyName: '_updatedDate' | 'emailSubject', value: boolean) => EmailTransmissionsQueryBuilder;
634
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
635
+ * @documentationMaturity preview
636
+ */
637
+ ascending: (...propertyNames: Array<'_id' | '_updatedDate' | 'emailSubject' | 'type' | 'status'>) => EmailTransmissionsQueryBuilder;
638
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
639
+ * @documentationMaturity preview
640
+ */
641
+ descending: (...propertyNames: Array<'_id' | '_updatedDate' | 'emailSubject' | 'type' | 'status'>) => EmailTransmissionsQueryBuilder;
642
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
643
+ * @documentationMaturity preview
644
+ */
645
+ limit: (limit: number) => EmailTransmissionsQueryBuilder;
646
+ /** @param cursor - A pointer to specific record
647
+ * @documentationMaturity preview
648
+ */
649
+ skipTo: (cursor: string) => EmailTransmissionsQueryBuilder;
650
+ /** @documentationMaturity preview */
651
+ find: () => Promise<EmailTransmissionsQueryResult>;
652
+ }
653
+ /**
654
+ * @hidden
655
+ * @fqn wix.emails.transmissions.v1.EmailTransmissionService.QueryEmailTransmissions
656
+ * @requiredField query
657
+ */
658
+ declare function typedQueryEmailTransmissions(query: EmailTransmissionQuery): Promise<NonNullablePaths<QueryEmailTransmissionsResponse, `emailTransmissions` | `emailTransmissions.${number}._id` | `emailTransmissions.${number}.emailHtmlContent` | `emailTransmissions.${number}.replyTo.contactId` | `emailTransmissions.${number}.replyTo.userId` | `emailTransmissions.${number}.replyTo.emailAddress` | `emailTransmissions.${number}.replyTo.failureReason` | `emailTransmissions.${number}.type` | `emailTransmissions.${number}.status`, 5>>;
659
+ interface EmailTransmissionQuerySpec extends QuerySpec {
660
+ paging: 'cursor';
661
+ wql: [
662
+ {
663
+ fields: ['_id', 'status', 'type'];
664
+ operators: ['$eq', '$in', '$ne'];
665
+ sort: 'BOTH';
666
+ },
667
+ {
668
+ fields: ['_updatedDate', 'emailSubject'];
669
+ operators: '*';
670
+ sort: 'BOTH';
671
+ }
672
+ ];
673
+ }
674
+ type CommonQueryWithEntityContext = Query<EmailTransmission, EmailTransmissionQuerySpec>;
675
+ type EmailTransmissionQuery = {
676
+ /**
677
+ Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.
678
+ */
679
+ cursorPaging?: {
680
+ /**
681
+ Number of items to load.
682
+ @max: 100
683
+ */
684
+ limit?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit'] | null;
685
+ /**
686
+ Pointer to the next or previous page in the list of results.
687
+
688
+ You can get the relevant cursor token
689
+ from the `pagingMetadata` object in the previous call's response.
690
+ Not relevant for the first request.
691
+ @maxLength: 1000
692
+ */
693
+ cursor?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor'] | null;
694
+ };
695
+ /**
696
+ Filter object in the following format:
697
+ `"filter" : {
698
+ "fieldName1": "value1",
699
+ "fieldName2":{"$operator":"value2"}
700
+ }`
701
+ Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
702
+ */
703
+ filter?: CommonQueryWithEntityContext['filter'] | null;
704
+ /**
705
+ Sort object in the following format:
706
+ `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
707
+ @maxSize: 4
708
+ */
709
+ sort?: {
710
+ /**
711
+ Name of the field to sort by.
712
+ @minLength: 1,
713
+ @maxLength: 50
714
+ */
715
+ fieldName?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['fieldName'];
716
+ /**
717
+ Sort order.
718
+ */
719
+ order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];
720
+ }[];
721
+ };
722
+ declare const utils: {
723
+ query: {
724
+ QueryBuilder: () => _wix_sdk_types.QueryBuilder<EmailTransmission, EmailTransmissionQuerySpec, EmailTransmissionQuery>;
725
+ Filter: _wix_sdk_types.FilterFactory<EmailTransmission, EmailTransmissionQuerySpec>;
726
+ Sort: _wix_sdk_types.SortFactory<EmailTransmissionQuerySpec>;
727
+ };
728
+ };
729
+ /**
730
+ * Delete email transmission by ID.
731
+ * Note that this operation is only allowed for PROCESSED or REJECTED email transmissions. Deleting an ACCEPTED or IN_PROGRESS email transmission will result in an error.
732
+ * @param emailTransmissionId - Id of the EmailTransmission to delete.
733
+ * @public
734
+ * @documentationMaturity preview
735
+ * @requiredField emailTransmissionId
736
+ * @permissionId shoutout.manage
737
+ * @applicableIdentity APP
738
+ * @fqn wix.emails.transmissions.v1.EmailTransmissionService.DeleteEmailTransmission
739
+ */
740
+ declare function deleteEmailTransmission(emailTransmissionId: string): Promise<void & {
741
+ __applicationErrorsType?: DeleteEmailTransmissionApplicationErrors;
742
+ }>;
743
+
744
+ export { type AccountInfo, type AccountSuspendedErrorDetails, type ActionEvent, type CommonQueryWithEntityContext, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteEmailTransmissionApplicationErrors, type DeleteEmailTransmissionRequest, type DeleteEmailTransmissionResponse, type DomainEvent, type DomainEventBodyOneOf, type EmailTransmission, type EmailTransmissionQuery, type EmailTransmissionQuerySpec, type EmailTransmissionStatusOptionsOneOf, type EmailTransmissionTypeOptionsOneOf, type EmailTransmissionsQueryBuilder, type EmailTransmissionsQueryResult, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, FailureReason, type FailureReasonWithLiterals, type GetEmailTransmissionRequest, type GetEmailTransmissionResponse, type IdentificationData, type IdentificationDataIdOneOf, type MarketingOptions, type MessageEnvelope, type OutOfQuotaErrorDetails, type QueryEmailTransmissionsRequest, type QueryEmailTransmissionsResponse, type Recipient, type RecipientValueOneOf, type RejectedOptions, RejectionReason, type RejectionReasonWithLiterals, type RestoreInfo, type SendEmailTransmissionApplicationErrors, type SendEmailTransmissionOptions, type SendEmailTransmissionRequest, type SendEmailTransmissionResponse, type SendEmailTransmissionValidationErrors, SortOrder, type SortOrderWithLiterals, type Sorting, Status, type StatusWithLiterals, Type, type TypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, deleteEmailTransmission, getEmailTransmission, queryEmailTransmissions, sendEmailTransmission, typedQueryEmailTransmissions, utils };