@outseta/api-client 0.4.2 → 0.4.4

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.
package/dist/index.js CHANGED
@@ -2298,6 +2298,7 @@ var ActivityType = {
2298
2298
  PlanUpdated: 401,
2299
2299
  AddOnCreated: 402,
2300
2300
  AddOnUpdated: 403,
2301
+ TransactionalEmailSettingUpdated: 404,
2301
2302
  DiscordUserLinked: 500,
2302
2303
  DiscordUserAddedToServer: 501,
2303
2304
  DiscordUserRolesUpdated: 502,
@@ -2588,6 +2589,7 @@ var QcountConfigSettingType = {
2588
2589
  MagicLinkLoginEnabled: 143,
2589
2590
  Support_DeleteClosedTicketsAfterMonths: 148,
2590
2591
  SingleSessionLogin: 149,
2592
+ CRM_PasswordChangedEmailDisabled: 152,
2591
2593
  GoogleAnalyticsMeasurementId: 170,
2592
2594
  GoogleAnalyticsApiSecret: 171,
2593
2595
  Stripe_TaxEnabled: 190,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outseta/api-client",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Generated API client for the Outseta REST API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1275,7 +1275,8 @@ export const accountExtendRenewal = async (accountUid: string | null,
1275
1275
  /**
1276
1276
  * Pass personUid as a query parameter to send to a specific person, or personUid=* to send
1277
1277
  to all people on the account. If no personUid is provided, the email is sent to the
1278
- primary contact.
1278
+ primary contact. The email is sent even when the Registration confirmation email is
1279
+ turned off under Email > Transactional emails.
1279
1280
  * @summary Send a confirmation email to people on an account.
1280
1281
  */
1281
1282
  export type accountSendConfirmationEmailResponse200 = {
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
2
 
3
3
  /**
4
- * `10` - Custom, `50` - Note, `51` - Email, `52` - PhoneCall, `53` - Meeting, `54` - Chat, `100` - AccountCreated, `101` - AccountUpdated, `102` - AccountAddPerson, `103` - AccountStageUpdated, `104` - AccountDeleted, `105` - AccountBillingInformationUpdated, `106` - AccountSubscriptionPlanUpdated, `107` - AccountSubscriptionPaymentCollected, `108` - AccountSubscriptionPaymentDeclined, `109` - AccountBillingInformationRequested, `110` - AccountBillingInvoiceEmailSent, `111` - AccountRemovePerson, `112` - AccountPaidSubscriptionCreated, `113` - AccountBillingInformationRemoved, `114` - AccountPrimaryPersonUpdated, `115` - AccountBillingInvoiceCreated, `116` - AccountSubscriptionStarted, `117` - AccountSubscriptionRenewalExtended, `118` - AccountSubscriptionAddOnsChanged, `119` - AccountSubscriptionCancellationRequested, `120` - AccountBillingInvoiceDeleted, `121` - AccountPersonRoleUpdated, `122` - AccountProductsChanged, `200` - PersonCreated, `201` - PersonUpdated, `202` - PersonDeleted, `203` - PersonLogin, `204` - PersonListSubscribed, `205` - PersonListUnsubscribed, `206` - PersonSegmentAdded, `207` - PersonSegmentRemoved, `208` - PersonEmailOpened, `209` - PersonEmailClicked, `210` - PersonEmailBounce, `211` - PersonEmailSpam, `212` - PersonSupportTicketCreated, `213` - PersonSupportTicketUpdated, `214` - PersonLeadFormSubmitted, `215` - PersonListConfirmed, `216` - PersonEmailSubscribed, `217` - PersonEmailUnsubscribed, `218` - PersonTemporaryPasswordSet, `219` - PersonSupportTicketClosed, `220` - PersonTwoFactorRecoveryCodesRegenerated, `300` - DealCreated, `301` - DealUpdated, `304` - DealDeleted, `305` - DealDueDate, `306` - TaskCreated, `307` - TaskUpdated, `400` - PlanCreated, `401` - PlanUpdated, `402` - AddOnCreated, `403` - AddOnUpdated, `500` - DiscordUserLinked, `501` - DiscordUserAddedToServer, `502` - DiscordUserRolesUpdated, `503` - DiscordUserRemovedFromServer
4
+ * `10` - Custom, `50` - Note, `51` - Email, `52` - PhoneCall, `53` - Meeting, `54` - Chat, `100` - AccountCreated, `101` - AccountUpdated, `102` - AccountAddPerson, `103` - AccountStageUpdated, `104` - AccountDeleted, `105` - AccountBillingInformationUpdated, `106` - AccountSubscriptionPlanUpdated, `107` - AccountSubscriptionPaymentCollected, `108` - AccountSubscriptionPaymentDeclined, `109` - AccountBillingInformationRequested, `110` - AccountBillingInvoiceEmailSent, `111` - AccountRemovePerson, `112` - AccountPaidSubscriptionCreated, `113` - AccountBillingInformationRemoved, `114` - AccountPrimaryPersonUpdated, `115` - AccountBillingInvoiceCreated, `116` - AccountSubscriptionStarted, `117` - AccountSubscriptionRenewalExtended, `118` - AccountSubscriptionAddOnsChanged, `119` - AccountSubscriptionCancellationRequested, `120` - AccountBillingInvoiceDeleted, `121` - AccountPersonRoleUpdated, `122` - AccountProductsChanged, `200` - PersonCreated, `201` - PersonUpdated, `202` - PersonDeleted, `203` - PersonLogin, `204` - PersonListSubscribed, `205` - PersonListUnsubscribed, `206` - PersonSegmentAdded, `207` - PersonSegmentRemoved, `208` - PersonEmailOpened, `209` - PersonEmailClicked, `210` - PersonEmailBounce, `211` - PersonEmailSpam, `212` - PersonSupportTicketCreated, `213` - PersonSupportTicketUpdated, `214` - PersonLeadFormSubmitted, `215` - PersonListConfirmed, `216` - PersonEmailSubscribed, `217` - PersonEmailUnsubscribed, `218` - PersonTemporaryPasswordSet, `219` - PersonSupportTicketClosed, `220` - PersonTwoFactorRecoveryCodesRegenerated, `300` - DealCreated, `301` - DealUpdated, `304` - DealDeleted, `305` - DealDueDate, `306` - TaskCreated, `307` - TaskUpdated, `400` - PlanCreated, `401` - PlanUpdated, `402` - AddOnCreated, `403` - AddOnUpdated, `404` - TransactionalEmailSettingUpdated, `500` - DiscordUserLinked, `501` - DiscordUserAddedToServer, `502` - DiscordUserRolesUpdated, `503` - DiscordUserRemovedFromServer
5
5
  */
6
6
  export type ActivityType = typeof ActivityType[keyof typeof ActivityType];
7
7
 
@@ -68,6 +68,7 @@ export const ActivityType = {
68
68
  PlanUpdated: 401,
69
69
  AddOnCreated: 402,
70
70
  AddOnUpdated: 403,
71
+ TransactionalEmailSettingUpdated: 404,
71
72
  DiscordUserLinked: 500,
72
73
  DiscordUserAddedToServer: 501,
73
74
  DiscordUserRolesUpdated: 502,
@@ -5,6 +5,9 @@ import type { BillingSystem } from './billingSystem';
5
5
  export type BillSettingsAllOf = {
6
6
  DaysPastDueToSetAccountToCanceling?: number;
7
7
  IsInvoicePaymentEmailDisabled: boolean;
8
+ IsInvoiceReminderEmailDisabled: boolean;
9
+ IsPaymentProblemEmailDisabled: boolean;
10
+ IsPaymentInfoUpdatedEmailDisabled: boolean;
8
11
  PaymentsMode?: PaymentsMode;
9
12
  BillingSystem?: BillingSystem;
10
13
  RestrictSubscriptionActions?: boolean;
@@ -819,9 +819,15 @@ export * from './templateEmailInstanceAllOfRecipient';
819
819
  export * from './templateEmailInstanceAllOfTemplate';
820
820
  export * from './templateGetAllTemplateEmails200';
821
821
  export * from './templateGetAllTemplateEmailsParams';
822
+ export * from './templateGetAllTemplates200';
823
+ export * from './templateGetAllTemplatesParams';
822
824
  export * from './templateGetTemplateEmails200';
823
825
  export * from './templateGetTemplateEmailsParams';
826
+ export * from './templateGetTransactionalEmailSettings200';
827
+ export * from './templateGetTransactionalEmailSettingsParams';
824
828
  export * from './templateSendTemplateEmailBody';
829
+ export * from './templateUpdateTransactionalEmailSettings200';
830
+ export * from './templateUpdateTransactionalEmailSettingsBody';
825
831
  export * from './temporaryPasswordModel';
826
832
  export * from './tokenPayload';
827
833
  export * from './tokenTwoFactorEnrollmentBeginEmailParams';
@@ -832,6 +838,9 @@ export * from './transaction';
832
838
  export * from './transactionAllOf';
833
839
  export * from './transactionAllOfAccount';
834
840
  export * from './transactionAllOfInvoice';
841
+ export * from './transactionalEmailSetting';
842
+ export * from './transactionalEmailSettingUpdate';
843
+ export * from './transactionalEmailSettingUpdateRequest';
835
844
  export * from './transactionsAddPaymentTransactionBody';
836
845
  export * from './transactionsGetAllTransactionsByAccountId200';
837
846
  export * from './transactionsGetAllTransactionsByAccountIdParams';
@@ -843,6 +852,7 @@ export * from './twoFactorTotpEnrollmentPayload';
843
852
  export * from './twoFactorVerifyRequest';
844
853
  export * from './updateAccountMemberRoleModel';
845
854
  export * from './updateAccountMemberRoleModelRole';
855
+ export * from './updateTemplateRequest';
846
856
  export * from './usage';
847
857
  export * from './usageAddUsageBody';
848
858
  export * from './usageAllOf';
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
2
 
3
3
  /**
4
- * `100` - Slack, `102` - MagicLinkApiKey, `103` - MagicLinkApiKeySecret, `104` - OAuth_HideCreateAccountLink, `105` - Chat_IsOffline, `106` - HostedPageCustomCode, `107` - RegistrationConfirmationEmailDelaySeconds, `108` - AccountCancellationReasons, `110` - WebhookSignatureKey, `111` - HostedProfileBackLink, `112` - AccountCancellationReasonRequired, `114` - Email_OutsetaBrandingDisabled, `119` - Email_BlacklistedInboundEmails, `121` - PasswordPolicy, `123` - CRM_FieldSortingEnabled, `124` - CRM_RegistrationCallbackLocations, `125` - KnowledgeBaseVersion, `126` - Support_SpamThreshold, `127` - Email_RestrictedPhrases, `128` - KnowledgeBaseLanguage, `130` - Billing_System, `131` - Billing_RestrictSubscriptionActions, `140` - TwoFactorAuthenticationEnabled, `142` - ForceTwoFactorAuthentication, `143` - MagicLinkLoginEnabled, `148` - Support_DeleteClosedTicketsAfterMonths, `149` - SingleSessionLogin, `170` - GoogleAnalyticsMeasurementId, `171` - GoogleAnalyticsApiSecret, `190` - Stripe_TaxEnabled, `192` - Stripe_TaxIdTypes, `193` - Stripe_ApplePayMerchantIdDomainAssociation, `194` - Stripe_WebhookSecret, `195` - Stripe_OnlySyncOutsetaCustomers, `196` - Stripe_Checkout_RequireBillingAddress, `197` - Stripe_Checkout_RequireConsentTermsOfService, `200` - Webflow_AccessToken, `201` - Webflow_SyncEnabled, `202` - Webflow_SyncConfiguration, `203` - Webflow_ApiVersion, `550` - CopyQcount_AddOnMap, `551` - CopyQcount_AccountMap, `552` - CopyQcount_DiscountCouponMap, `553` - CopyQcount_InvoiceMap, `554` - CopyQcount_PersonMap, `555` - CopyQcount_PlanMap, `556` - CopyQcount_PlanFamilyMap, `557` - CopyQcount_SubscriptionMap, `558` - CopyQcount_TransactionMap, `570` - StripeMigration_LastAccountId, `571` - StripeMigration_LastInvoiceId, `572` - StripeMigration_LastExpiredSubscriptionId, `573` - StripeMigration_LastPostExportSubscriptionId, `574` - StripeMigration_LastUsageId, `575` - StripeMigration_SubscriptionExportDate, `576` - StripeMigration_SubscriptionExportIds, `577` - StripeMigration_SubscriptionAddOnExportIds, `578` - StripeMigration_SubscriptionCutoverDate, `579` - StripeMigration_LastPreCutoverExportSubscriptionId
4
+ * `100` - Slack, `102` - MagicLinkApiKey, `103` - MagicLinkApiKeySecret, `104` - OAuth_HideCreateAccountLink, `105` - Chat_IsOffline, `106` - HostedPageCustomCode, `107` - RegistrationConfirmationEmailDelaySeconds, `108` - AccountCancellationReasons, `110` - WebhookSignatureKey, `111` - HostedProfileBackLink, `112` - AccountCancellationReasonRequired, `114` - Email_OutsetaBrandingDisabled, `119` - Email_BlacklistedInboundEmails, `121` - PasswordPolicy, `123` - CRM_FieldSortingEnabled, `124` - CRM_RegistrationCallbackLocations, `125` - KnowledgeBaseVersion, `126` - Support_SpamThreshold, `127` - Email_RestrictedPhrases, `128` - KnowledgeBaseLanguage, `130` - Billing_System, `131` - Billing_RestrictSubscriptionActions, `140` - TwoFactorAuthenticationEnabled, `142` - ForceTwoFactorAuthentication, `143` - MagicLinkLoginEnabled, `148` - Support_DeleteClosedTicketsAfterMonths, `149` - SingleSessionLogin, `152` - CRM_PasswordChangedEmailDisabled, `170` - GoogleAnalyticsMeasurementId, `171` - GoogleAnalyticsApiSecret, `190` - Stripe_TaxEnabled, `192` - Stripe_TaxIdTypes, `193` - Stripe_ApplePayMerchantIdDomainAssociation, `194` - Stripe_WebhookSecret, `195` - Stripe_OnlySyncOutsetaCustomers, `196` - Stripe_Checkout_RequireBillingAddress, `197` - Stripe_Checkout_RequireConsentTermsOfService, `200` - Webflow_AccessToken, `201` - Webflow_SyncEnabled, `202` - Webflow_SyncConfiguration, `203` - Webflow_ApiVersion, `550` - CopyQcount_AddOnMap, `551` - CopyQcount_AccountMap, `552` - CopyQcount_DiscountCouponMap, `553` - CopyQcount_InvoiceMap, `554` - CopyQcount_PersonMap, `555` - CopyQcount_PlanMap, `556` - CopyQcount_PlanFamilyMap, `557` - CopyQcount_SubscriptionMap, `558` - CopyQcount_TransactionMap, `570` - StripeMigration_LastAccountId, `571` - StripeMigration_LastInvoiceId, `572` - StripeMigration_LastExpiredSubscriptionId, `573` - StripeMigration_LastPostExportSubscriptionId, `574` - StripeMigration_LastUsageId, `575` - StripeMigration_SubscriptionExportDate, `576` - StripeMigration_SubscriptionExportIds, `577` - StripeMigration_SubscriptionAddOnExportIds, `578` - StripeMigration_SubscriptionCutoverDate, `579` - StripeMigration_LastPreCutoverExportSubscriptionId
5
5
  */
6
6
  export type QcountConfigSettingType = typeof QcountConfigSettingType[keyof typeof QcountConfigSettingType];
7
7
 
@@ -35,6 +35,7 @@ export const QcountConfigSettingType = {
35
35
  MagicLinkLoginEnabled: 143,
36
36
  Support_DeleteClosedTicketsAfterMonths: 148,
37
37
  SingleSessionLogin: 149,
38
+ CRM_PasswordChangedEmailDisabled: 152,
38
39
  GoogleAnalyticsMeasurementId: 170,
39
40
  GoogleAnalyticsApiSecret: 171,
40
41
  Stripe_TaxEnabled: 190,
@@ -0,0 +1,8 @@
1
+ // @ts-nocheck
2
+ import type { CollectionMetadata } from './collectionMetadata';
3
+ import type { Template } from './template';
4
+
5
+ export type TemplateGetAllTemplates200 = {
6
+ metadata?: CollectionMetadata;
7
+ items?: Template[];
8
+ };
@@ -0,0 +1,14 @@
1
+ // @ts-nocheck
2
+ import type { LimitParameter } from './limitParameter';
3
+ import type { OffsetParameter } from './offsetParameter';
4
+
5
+ export type TemplateGetAllTemplatesParams = {
6
+ /**
7
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
8
+ */
9
+ limit?: LimitParameter;
10
+ /**
11
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
12
+ */
13
+ offset?: OffsetParameter;
14
+ };
@@ -0,0 +1,8 @@
1
+ // @ts-nocheck
2
+ import type { CollectionMetadata } from './collectionMetadata';
3
+ import type { TransactionalEmailSetting } from './transactionalEmailSetting';
4
+
5
+ export type TemplateGetTransactionalEmailSettings200 = {
6
+ metadata?: CollectionMetadata;
7
+ items?: TransactionalEmailSetting[];
8
+ };
@@ -0,0 +1,14 @@
1
+ // @ts-nocheck
2
+ import type { LimitParameter } from './limitParameter';
3
+ import type { OffsetParameter } from './offsetParameter';
4
+
5
+ export type TemplateGetTransactionalEmailSettingsParams = {
6
+ /**
7
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
8
+ */
9
+ limit?: LimitParameter;
10
+ /**
11
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
12
+ */
13
+ offset?: OffsetParameter;
14
+ };
@@ -0,0 +1,8 @@
1
+ // @ts-nocheck
2
+ import type { CollectionMetadata } from './collectionMetadata';
3
+ import type { TransactionalEmailSetting } from './transactionalEmailSetting';
4
+
5
+ export type TemplateUpdateTransactionalEmailSettings200 = {
6
+ metadata?: CollectionMetadata;
7
+ items?: TransactionalEmailSetting[];
8
+ };
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+ import type { TransactionalEmailSettingUpdateRequest } from './transactionalEmailSettingUpdateRequest';
3
+
4
+ /**
5
+ * @nullable
6
+ */
7
+ export type TemplateUpdateTransactionalEmailSettingsBody = TransactionalEmailSettingUpdateRequest | null;
@@ -0,0 +1,13 @@
1
+ // @ts-nocheck
2
+
3
+ export interface TransactionalEmailSetting {
4
+ /** @nullable */
5
+ Key?: string | null;
6
+ /** @nullable */
7
+ Name?: string | null;
8
+ /** @nullable */
9
+ SentWhen?: string | null;
10
+ /** @nullable */
11
+ TemplateSystemNames?: string[] | null;
12
+ IsEnabled?: boolean;
13
+ }
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+
3
+ export interface TransactionalEmailSettingUpdate {
4
+ /** @nullable */
5
+ Key?: string | null;
6
+ IsEnabled?: boolean;
7
+ }
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+ import type { TransactionalEmailSettingUpdate } from './transactionalEmailSettingUpdate';
3
+
4
+ export interface TransactionalEmailSettingUpdateRequest {
5
+ /** @nullable */
6
+ Settings?: TransactionalEmailSettingUpdate[] | null;
7
+ }
@@ -0,0 +1,30 @@
1
+ // @ts-nocheck
2
+
3
+ /**
4
+ * The fields of an email template that an update may change. Every field is optional:
5
+ a field left out keeps its current value.
6
+ */
7
+ export interface UpdateTemplateRequest {
8
+ /** The HTML of the template. May use Liquid tokens, for example {{ Person.FirstName }},
9
+ and must keep every token in the template's RequiredTokens. Cannot be null. */
10
+ Body?: string;
11
+ /**
12
+ * What the template is for. Cannot be changed for a system email.
13
+ * @nullable
14
+ */
15
+ Description?: string | null;
16
+ /**
17
+ * The design of the template in the drag-and-drop editor, as JSON. Send null with a new
18
+ Body so the editor opens the new Body as HTML instead of the old design.
19
+ * @nullable
20
+ */
21
+ Design?: string | null;
22
+ /** The name of the template, shown in the Outseta app. Cannot be changed for a system
23
+ email. Cannot be null. */
24
+ Name?: string;
25
+ /**
26
+ * The subject line of the email. May use Liquid tokens, for example {{ CompanyName }}.
27
+ * @nullable
28
+ */
29
+ Subject?: string | null;
30
+ }
@@ -1,15 +1,88 @@
1
1
  // @ts-nocheck
2
2
  import type {
3
+ Template,
3
4
  TemplateEmailInstance,
4
5
  TemplateGetAllTemplateEmails200,
5
6
  TemplateGetAllTemplateEmailsParams,
7
+ TemplateGetAllTemplates200,
8
+ TemplateGetAllTemplatesParams,
6
9
  TemplateGetTemplateEmails200,
7
10
  TemplateGetTemplateEmailsParams,
8
- TemplateSendTemplateEmailBody
11
+ TemplateGetTransactionalEmailSettings200,
12
+ TemplateGetTransactionalEmailSettingsParams,
13
+ TemplateSendTemplateEmailBody,
14
+ TemplateUpdateTransactionalEmailSettings200,
15
+ TemplateUpdateTransactionalEmailSettingsBody,
16
+ UpdateTemplateRequest
9
17
  } from '.././models';
10
18
 
11
19
  import { customFetch } from '../../client';
12
20
 
21
+ /**
22
+ * The list holds the templates from Email > Email templates (Tag template), the email
23
+ layouts (Tag layout), the broadcast wrapper (Tag wrapper), the saved support replies
24
+ (Tag savedReply) and the system emails Outseta sends, such as the registration
25
+ confirmation (Tag email). A system email has a SystemName, which never changes. Filter
26
+ with Tag=email or SystemName to find one.
27
+
28
+ Body and Design are left out to keep the list small, except that a system email the
29
+ account never edited carries its default Body. Read a template with the get endpoint to
30
+ see its Body and Design.
31
+
32
+ A system email the account never edited is not stored yet. It is listed with a Uid
33
+ that starts with int_, which can be used like any other Uid. Saving the system email
34
+ stores the account's own copy, which has a regular Uid from then on. An int_ Uid can
35
+ change when Outseta adds system emails, so keep the SystemName rather than the int_ Uid.
36
+
37
+ Internal system emails that accounts cannot change are not listed.
38
+ * @summary The email templates, layouts and system emails of the account.
39
+ */
40
+ export type templateGetAllTemplatesResponse200 = {
41
+ data: TemplateGetAllTemplates200
42
+ status: 200
43
+ }
44
+
45
+ export type templateGetAllTemplatesResponse401 = {
46
+ data: void
47
+ status: 401
48
+ }
49
+
50
+ export type templateGetAllTemplatesResponseSuccess = (templateGetAllTemplatesResponse200) & {
51
+ headers: Headers;
52
+ };
53
+ export type templateGetAllTemplatesResponseError = (templateGetAllTemplatesResponse401) & {
54
+ headers: Headers;
55
+ };
56
+
57
+ export type templateGetAllTemplatesResponse = (templateGetAllTemplatesResponseSuccess | templateGetAllTemplatesResponseError)
58
+
59
+ export const getTemplateGetAllTemplatesUrl = (params?: TemplateGetAllTemplatesParams,) => {
60
+ const normalizedParams = new URLSearchParams();
61
+
62
+ Object.entries(params || {}).forEach(([key, value]) => {
63
+
64
+ if (value !== undefined) {
65
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
66
+ }
67
+ });
68
+
69
+ const stringifiedParams = normalizedParams.toString();
70
+
71
+ return stringifiedParams.length > 0 ? `/api/v1/templates?${stringifiedParams}` : `/api/v1/templates`
72
+ }
73
+
74
+ export const templateGetAllTemplates = async (params?: TemplateGetAllTemplatesParams, options?: RequestInit): Promise<templateGetAllTemplatesResponse> => {
75
+
76
+ return customFetch<templateGetAllTemplatesResponse>(getTemplateGetAllTemplatesUrl(params),
77
+ {
78
+ ...options,
79
+ method: 'GET'
80
+
81
+
82
+ }
83
+ );}
84
+
85
+
13
86
  /**
14
87
  * Filter with personUid to see what one person was sent, or with templateUid to
15
88
  restrict the results to a single template.
@@ -61,6 +134,104 @@ export const templateGetAllTemplateEmails = async (params?: TemplateGetAllTempla
61
134
  );}
62
135
 
63
136
 
137
+ /**
138
+ * Each setting names the email templates it covers. A setting that is off stops the
139
+ automatic email only; an email sent by hand, such as the send invoice button, is
140
+ still sent.
141
+ * @summary The on/off settings for the transactional emails that Outseta sends to your customers.
142
+ */
143
+ export type templateGetTransactionalEmailSettingsResponse200 = {
144
+ data: TemplateGetTransactionalEmailSettings200
145
+ status: 200
146
+ }
147
+
148
+ export type templateGetTransactionalEmailSettingsResponse401 = {
149
+ data: void
150
+ status: 401
151
+ }
152
+
153
+ export type templateGetTransactionalEmailSettingsResponseSuccess = (templateGetTransactionalEmailSettingsResponse200) & {
154
+ headers: Headers;
155
+ };
156
+ export type templateGetTransactionalEmailSettingsResponseError = (templateGetTransactionalEmailSettingsResponse401) & {
157
+ headers: Headers;
158
+ };
159
+
160
+ export type templateGetTransactionalEmailSettingsResponse = (templateGetTransactionalEmailSettingsResponseSuccess | templateGetTransactionalEmailSettingsResponseError)
161
+
162
+ export const getTemplateGetTransactionalEmailSettingsUrl = (params?: TemplateGetTransactionalEmailSettingsParams,) => {
163
+ const normalizedParams = new URLSearchParams();
164
+
165
+ Object.entries(params || {}).forEach(([key, value]) => {
166
+
167
+ if (value !== undefined) {
168
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
169
+ }
170
+ });
171
+
172
+ const stringifiedParams = normalizedParams.toString();
173
+
174
+ return stringifiedParams.length > 0 ? `/api/v1/templates/transactional-email-settings?${stringifiedParams}` : `/api/v1/templates/transactional-email-settings`
175
+ }
176
+
177
+ export const templateGetTransactionalEmailSettings = async (params?: TemplateGetTransactionalEmailSettingsParams, options?: RequestInit): Promise<templateGetTransactionalEmailSettingsResponse> => {
178
+
179
+ return customFetch<templateGetTransactionalEmailSettingsResponse>(getTemplateGetTransactionalEmailSettingsUrl(params),
180
+ {
181
+ ...options,
182
+ method: 'GET'
183
+
184
+
185
+ }
186
+ );}
187
+
188
+
189
+ /**
190
+ * Send an object with a Settings list. Each item has Key and IsEnabled. A setting that
191
+ is not in the list keeps its state. Each change is recorded in the activity log.
192
+ Returns all settings.
193
+ * @summary Turns transactional emails on or off.
194
+ */
195
+ export type templateUpdateTransactionalEmailSettingsResponse200 = {
196
+ data: TemplateUpdateTransactionalEmailSettings200
197
+ status: 200
198
+ }
199
+
200
+ export type templateUpdateTransactionalEmailSettingsResponse401 = {
201
+ data: void
202
+ status: 401
203
+ }
204
+
205
+ export type templateUpdateTransactionalEmailSettingsResponseSuccess = (templateUpdateTransactionalEmailSettingsResponse200) & {
206
+ headers: Headers;
207
+ };
208
+ export type templateUpdateTransactionalEmailSettingsResponseError = (templateUpdateTransactionalEmailSettingsResponse401) & {
209
+ headers: Headers;
210
+ };
211
+
212
+ export type templateUpdateTransactionalEmailSettingsResponse = (templateUpdateTransactionalEmailSettingsResponseSuccess | templateUpdateTransactionalEmailSettingsResponseError)
213
+
214
+ export const getTemplateUpdateTransactionalEmailSettingsUrl = () => {
215
+
216
+
217
+
218
+
219
+ return `/api/v1/templates/transactional-email-settings`
220
+ }
221
+
222
+ export const templateUpdateTransactionalEmailSettings = async (templateUpdateTransactionalEmailSettingsBody: TemplateUpdateTransactionalEmailSettingsBody, options?: RequestInit): Promise<templateUpdateTransactionalEmailSettingsResponse> => {
223
+
224
+ return customFetch<templateUpdateTransactionalEmailSettingsResponse>(getTemplateUpdateTransactionalEmailSettingsUrl(),
225
+ {
226
+ ...options,
227
+ method: 'PUT',
228
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
229
+ body: JSON.stringify(
230
+ templateUpdateTransactionalEmailSettingsBody,)
231
+ }
232
+ );}
233
+
234
+
64
235
  /**
65
236
  * Add personUid to the query string to see what one person was sent from this
66
237
  template.
@@ -124,6 +295,144 @@ export const templateGetTemplateEmails = async (templateUid: string | null,
124
295
  );}
125
296
 
126
297
 
298
+ /**
299
+ * Body is the HTML of the email; Subject and Body may use Liquid tokens such as
300
+ {{ Person.FirstName }}. AvailableTokens lists the tokens Outseta fills in for a system
301
+ email, and RequiredTokens the ones its Body must keep (for example ConfirmationUrl in the
302
+ registration confirmation).
303
+
304
+ Design is the drag-and-drop editor's design of the template as JSON, or null for a
305
+ template that is plain HTML. System emails have no Design.
306
+
307
+ A system email the account never edited returns its default content under its int_ Uid
308
+ from the list endpoint.
309
+ * @summary Get an email template, layout or system email, with its Body and Design.
310
+ */
311
+ export type templateGetTemplateResponse200 = {
312
+ data: Template
313
+ status: 200
314
+ }
315
+
316
+ export type templateGetTemplateResponse400 = {
317
+ data: void
318
+ status: 400
319
+ }
320
+
321
+ export type templateGetTemplateResponse401 = {
322
+ data: void
323
+ status: 401
324
+ }
325
+
326
+ export type templateGetTemplateResponse404 = {
327
+ data: void
328
+ status: 404
329
+ }
330
+
331
+ export type templateGetTemplateResponseSuccess = (templateGetTemplateResponse200) & {
332
+ headers: Headers;
333
+ };
334
+ export type templateGetTemplateResponseError = (templateGetTemplateResponse400 | templateGetTemplateResponse401 | templateGetTemplateResponse404) & {
335
+ headers: Headers;
336
+ };
337
+
338
+ export type templateGetTemplateResponse = (templateGetTemplateResponseSuccess | templateGetTemplateResponseError)
339
+
340
+ export const getTemplateGetTemplateUrl = (templateUid: string | null,) => {
341
+
342
+
343
+
344
+
345
+ return `/api/v1/templates/${templateUid}`
346
+ }
347
+
348
+ export const templateGetTemplate = async (templateUid: string | null, options?: RequestInit): Promise<templateGetTemplateResponse> => {
349
+
350
+ return customFetch<templateGetTemplateResponse>(getTemplateGetTemplateUrl(templateUid),
351
+ {
352
+ ...options,
353
+ method: 'GET'
354
+
355
+
356
+ }
357
+ );}
358
+
359
+
360
+ /**
361
+ * Send only the fields to change, usually Subject and Body. Fields left out of the request
362
+ keep their current values; a field sent as null is cleared. The Uid in the request body
363
+ is ignored.
364
+
365
+ Subject and Body must be valid Liquid, and Body must keep every token in RequiredTokens
366
+ (for example ConfirmationUrl in the registration confirmation); otherwise the update is
367
+ rejected with a validation error. The Name, Description and SystemName of a system email
368
+ cannot be changed.
369
+
370
+ A template with a Design (made in the drag-and-drop editor of Email > Email templates)
371
+ opens in the editor from its Design, not its Body. To change the Body of such a
372
+ template, send Design as null as well: the editor then opens the new Body as HTML.
373
+ Otherwise the editor keeps showing the old design, and saving the template there
374
+ replaces the new Body. System emails have no Design.
375
+
376
+ A system email the account never edited has a Uid that starts with int_. Updating it
377
+ stores the account's own copy, with the default content for the fields left out, and
378
+ returns it with its new Uid. From then on Outseta sends the copy; the int_ Uid
379
+ returns 404.
380
+
381
+ On an Outseta account that is not verified yet, updating a system email pauses all email
382
+ sending of the account, as it does in the Outseta app.
383
+ * @summary Update an email template, layout or system email.
384
+ */
385
+ export type templateUpdateTemplateResponse200 = {
386
+ data: Template
387
+ status: 200
388
+ }
389
+
390
+ export type templateUpdateTemplateResponse400 = {
391
+ data: void
392
+ status: 400
393
+ }
394
+
395
+ export type templateUpdateTemplateResponse401 = {
396
+ data: void
397
+ status: 401
398
+ }
399
+
400
+ export type templateUpdateTemplateResponse404 = {
401
+ data: void
402
+ status: 404
403
+ }
404
+
405
+ export type templateUpdateTemplateResponseSuccess = (templateUpdateTemplateResponse200) & {
406
+ headers: Headers;
407
+ };
408
+ export type templateUpdateTemplateResponseError = (templateUpdateTemplateResponse400 | templateUpdateTemplateResponse401 | templateUpdateTemplateResponse404) & {
409
+ headers: Headers;
410
+ };
411
+
412
+ export type templateUpdateTemplateResponse = (templateUpdateTemplateResponseSuccess | templateUpdateTemplateResponseError)
413
+
414
+ export const getTemplateUpdateTemplateUrl = (templateUid: string | null,) => {
415
+
416
+
417
+
418
+
419
+ return `/api/v1/templates/${templateUid}`
420
+ }
421
+
422
+ export const templateUpdateTemplate = async (templateUid: string | null,
423
+ updateTemplateRequest: UpdateTemplateRequest, options?: RequestInit): Promise<templateUpdateTemplateResponse> => {
424
+
425
+ return customFetch<templateUpdateTemplateResponse>(getTemplateUpdateTemplateUrl(templateUid),
426
+ {
427
+ ...options,
428
+ method: 'PUT',
429
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
430
+ body: JSON.stringify(
431
+ updateTemplateRequest,)
432
+ }
433
+ );}
434
+
435
+
127
436
  /**
128
437
  * The email is merge-rendered for the person and sent immediately. No broadcast
129
438
  is created. People who have bounced, unsubscribed or reported spam are not sent