@outseta/react 0.5.2 → 0.5.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
|
@@ -4834,6 +4834,7 @@ var QcountConfigSettingType = {
|
|
|
4834
4834
|
MagicLinkLoginEnabled: 143,
|
|
4835
4835
|
Support_DeleteClosedTicketsAfterMonths: 148,
|
|
4836
4836
|
SingleSessionLogin: 149,
|
|
4837
|
+
CRM_PasswordChangedEmailDisabled: 152,
|
|
4837
4838
|
GoogleAnalyticsMeasurementId: 170,
|
|
4838
4839
|
GoogleAnalyticsApiSecret: 171,
|
|
4839
4840
|
Stripe_TaxEnabled: 190,
|
|
@@ -4928,6 +4929,7 @@ var ActivityType = {
|
|
|
4928
4929
|
PlanUpdated: 401,
|
|
4929
4930
|
AddOnCreated: 402,
|
|
4930
4931
|
AddOnUpdated: 403,
|
|
4932
|
+
TransactionalEmailSettingUpdated: 404,
|
|
4931
4933
|
DiscordUserLinked: 500,
|
|
4932
4934
|
DiscordUserAddedToServer: 501,
|
|
4933
4935
|
DiscordUserRolesUpdated: 502,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outseta/react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "React hooks and components for the Outseta API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@outseta/api-client": "0.4.
|
|
21
|
+
"@outseta/api-client": "0.4.4"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^18.0.0 || ^19.0.0"
|
package/src/generated/crm/crm.ts
CHANGED
|
@@ -1583,7 +1583,8 @@ export const useAccountExtendRenewal = <TError = void,
|
|
|
1583
1583
|
/**
|
|
1584
1584
|
* Pass personUid as a query parameter to send to a specific person, or personUid=* to send
|
|
1585
1585
|
to all people on the account. If no personUid is provided, the email is sent to the
|
|
1586
|
-
primary contact.
|
|
1586
|
+
primary contact. The email is sent even when the Registration confirmation email is
|
|
1587
|
+
turned off under Email > Transactional emails.
|
|
1587
1588
|
* @summary Send a confirmation email to people on an account.
|
|
1588
1589
|
*/
|
|
1589
1590
|
export const accountSendConfirmationEmail = (
|
|
@@ -3497,7 +3497,7 @@ export type QcountConfigAllOf = {
|
|
|
3497
3497
|
export type QcountConfig = AbstractQcountBean & QcountConfigAllOf;
|
|
3498
3498
|
|
|
3499
3499
|
/**
|
|
3500
|
-
* `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
|
|
3500
|
+
* `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
|
|
3501
3501
|
*/
|
|
3502
3502
|
export type QcountConfigSettingType = typeof QcountConfigSettingType[keyof typeof QcountConfigSettingType];
|
|
3503
3503
|
|
|
@@ -3531,6 +3531,7 @@ export const QcountConfigSettingType = {
|
|
|
3531
3531
|
MagicLinkLoginEnabled: 143,
|
|
3532
3532
|
Support_DeleteClosedTicketsAfterMonths: 148,
|
|
3533
3533
|
SingleSessionLogin: 149,
|
|
3534
|
+
CRM_PasswordChangedEmailDisabled: 152,
|
|
3534
3535
|
GoogleAnalyticsMeasurementId: 170,
|
|
3535
3536
|
GoogleAnalyticsApiSecret: 171,
|
|
3536
3537
|
Stripe_TaxEnabled: 190,
|
|
@@ -3682,7 +3683,7 @@ export interface SlackChannelSetting {
|
|
|
3682
3683
|
}
|
|
3683
3684
|
|
|
3684
3685
|
/**
|
|
3685
|
-
* `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
|
|
3686
|
+
* `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
|
|
3686
3687
|
*/
|
|
3687
3688
|
export type ActivityType = typeof ActivityType[keyof typeof ActivityType];
|
|
3688
3689
|
|
|
@@ -3749,12 +3750,49 @@ export const ActivityType = {
|
|
|
3749
3750
|
PlanUpdated: 401,
|
|
3750
3751
|
AddOnCreated: 402,
|
|
3751
3752
|
AddOnUpdated: 403,
|
|
3753
|
+
TransactionalEmailSettingUpdated: 404,
|
|
3752
3754
|
DiscordUserLinked: 500,
|
|
3753
3755
|
DiscordUserAddedToServer: 501,
|
|
3754
3756
|
DiscordUserRolesUpdated: 502,
|
|
3755
3757
|
DiscordUserRemovedFromServer: 503,
|
|
3756
3758
|
} as const;
|
|
3757
3759
|
|
|
3760
|
+
export type TemplateAllOf = {
|
|
3761
|
+
/**
|
|
3762
|
+
* @minLength 1
|
|
3763
|
+
* @maxLength 250
|
|
3764
|
+
*/
|
|
3765
|
+
Name: string;
|
|
3766
|
+
/**
|
|
3767
|
+
* @maxLength 1000
|
|
3768
|
+
* @nullable
|
|
3769
|
+
*/
|
|
3770
|
+
Subject?: string | null;
|
|
3771
|
+
/** @minLength 1 */
|
|
3772
|
+
Body: string;
|
|
3773
|
+
/** @nullable */
|
|
3774
|
+
Design?: string | null;
|
|
3775
|
+
/**
|
|
3776
|
+
* @maxLength 1000
|
|
3777
|
+
* @nullable
|
|
3778
|
+
*/
|
|
3779
|
+
Description?: string | null;
|
|
3780
|
+
/**
|
|
3781
|
+
* @maxLength 50
|
|
3782
|
+
* @nullable
|
|
3783
|
+
*/
|
|
3784
|
+
SystemName?: string | null;
|
|
3785
|
+
IsInternal?: boolean;
|
|
3786
|
+
/** @nullable */
|
|
3787
|
+
AvailableTokens?: string | null;
|
|
3788
|
+
/** @nullable */
|
|
3789
|
+
RequiredTokens?: string | null;
|
|
3790
|
+
/** @nullable */
|
|
3791
|
+
Tag?: string | null;
|
|
3792
|
+
};
|
|
3793
|
+
|
|
3794
|
+
export type Template = AbstractQcountBean & TemplateAllOf;
|
|
3795
|
+
|
|
3758
3796
|
/**
|
|
3759
3797
|
* @nullable
|
|
3760
3798
|
*/
|
|
@@ -3811,41 +3849,57 @@ export type TemplateEmailInstanceAllOf = {
|
|
|
3811
3849
|
|
|
3812
3850
|
export type TemplateEmailInstance = AbstractQcountBean & TemplateEmailInstanceAllOf;
|
|
3813
3851
|
|
|
3814
|
-
export
|
|
3815
|
-
/**
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3852
|
+
export interface TransactionalEmailSetting {
|
|
3853
|
+
/** @nullable */
|
|
3854
|
+
Key?: string | null;
|
|
3855
|
+
/** @nullable */
|
|
3856
|
+
Name?: string | null;
|
|
3857
|
+
/** @nullable */
|
|
3858
|
+
SentWhen?: string | null;
|
|
3859
|
+
/** @nullable */
|
|
3860
|
+
TemplateSystemNames?: string[] | null;
|
|
3861
|
+
IsEnabled?: boolean;
|
|
3862
|
+
}
|
|
3863
|
+
|
|
3864
|
+
export interface TransactionalEmailSettingUpdateRequest {
|
|
3865
|
+
/** @nullable */
|
|
3866
|
+
Settings?: TransactionalEmailSettingUpdate[] | null;
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3869
|
+
export interface TransactionalEmailSettingUpdate {
|
|
3870
|
+
/** @nullable */
|
|
3871
|
+
Key?: string | null;
|
|
3872
|
+
IsEnabled?: boolean;
|
|
3873
|
+
}
|
|
3874
|
+
|
|
3875
|
+
/**
|
|
3876
|
+
* The fields of an email template that an update may change. Every field is optional:
|
|
3877
|
+
a field left out keeps its current value.
|
|
3878
|
+
*/
|
|
3879
|
+
export interface UpdateTemplateRequest {
|
|
3880
|
+
/** The HTML of the template. May use Liquid tokens, for example {{ Person.FirstName }},
|
|
3881
|
+
and must keep every token in the template's RequiredTokens. Cannot be null. */
|
|
3882
|
+
Body?: string;
|
|
3820
3883
|
/**
|
|
3821
|
-
*
|
|
3884
|
+
* What the template is for. Cannot be changed for a system email.
|
|
3822
3885
|
* @nullable
|
|
3823
3886
|
*/
|
|
3824
|
-
|
|
3825
|
-
/** @minLength 1 */
|
|
3826
|
-
Body: string;
|
|
3827
|
-
/** @nullable */
|
|
3828
|
-
Design?: string | null;
|
|
3887
|
+
Description?: string | null;
|
|
3829
3888
|
/**
|
|
3830
|
-
*
|
|
3889
|
+
* The design of the template in the drag-and-drop editor, as JSON. Send null with a new
|
|
3890
|
+
Body so the editor opens the new Body as HTML instead of the old design.
|
|
3831
3891
|
* @nullable
|
|
3832
3892
|
*/
|
|
3833
|
-
|
|
3893
|
+
Design?: string | null;
|
|
3894
|
+
/** The name of the template, shown in the Outseta app. Cannot be changed for a system
|
|
3895
|
+
email. Cannot be null. */
|
|
3896
|
+
Name?: string;
|
|
3834
3897
|
/**
|
|
3835
|
-
*
|
|
3898
|
+
* The subject line of the email. May use Liquid tokens, for example {{ CompanyName }}.
|
|
3836
3899
|
* @nullable
|
|
3837
3900
|
*/
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
/** @nullable */
|
|
3841
|
-
AvailableTokens?: string | null;
|
|
3842
|
-
/** @nullable */
|
|
3843
|
-
RequiredTokens?: string | null;
|
|
3844
|
-
/** @nullable */
|
|
3845
|
-
Tag?: string | null;
|
|
3846
|
-
};
|
|
3847
|
-
|
|
3848
|
-
export type Template = AbstractQcountBean & TemplateAllOf;
|
|
3901
|
+
Subject?: string | null;
|
|
3902
|
+
}
|
|
3849
3903
|
|
|
3850
3904
|
export interface SendTemplateEmailRequest {
|
|
3851
3905
|
/**
|
|
@@ -5064,6 +5118,9 @@ export interface ExtendSubscriptionOptions {
|
|
|
5064
5118
|
export type BillSettingsAllOf = {
|
|
5065
5119
|
DaysPastDueToSetAccountToCanceling?: number;
|
|
5066
5120
|
IsInvoicePaymentEmailDisabled: boolean;
|
|
5121
|
+
IsInvoiceReminderEmailDisabled: boolean;
|
|
5122
|
+
IsPaymentProblemEmailDisabled: boolean;
|
|
5123
|
+
IsPaymentInfoUpdatedEmailDisabled: boolean;
|
|
5067
5124
|
PaymentsMode?: PaymentsMode;
|
|
5068
5125
|
BillingSystem?: BillingSystem;
|
|
5069
5126
|
RestrictSubscriptionActions?: boolean;
|
|
@@ -9830,6 +9887,22 @@ export type CategoryGetAllCategories200 = {
|
|
|
9830
9887
|
items?: Category[];
|
|
9831
9888
|
};
|
|
9832
9889
|
|
|
9890
|
+
export type TemplateGetAllTemplatesParams = {
|
|
9891
|
+
/**
|
|
9892
|
+
* 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.
|
|
9893
|
+
*/
|
|
9894
|
+
limit?: LimitParameter;
|
|
9895
|
+
/**
|
|
9896
|
+
* 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).
|
|
9897
|
+
*/
|
|
9898
|
+
offset?: OffsetParameter;
|
|
9899
|
+
};
|
|
9900
|
+
|
|
9901
|
+
export type TemplateGetAllTemplates200 = {
|
|
9902
|
+
metadata?: CollectionMetadata;
|
|
9903
|
+
items?: Template[];
|
|
9904
|
+
};
|
|
9905
|
+
|
|
9833
9906
|
export type TemplateGetAllTemplateEmailsParams = {
|
|
9834
9907
|
/**
|
|
9835
9908
|
* 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.
|
|
@@ -9846,6 +9919,32 @@ export type TemplateGetAllTemplateEmails200 = {
|
|
|
9846
9919
|
items?: TemplateEmailInstance[];
|
|
9847
9920
|
};
|
|
9848
9921
|
|
|
9922
|
+
export type TemplateGetTransactionalEmailSettingsParams = {
|
|
9923
|
+
/**
|
|
9924
|
+
* 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.
|
|
9925
|
+
*/
|
|
9926
|
+
limit?: LimitParameter;
|
|
9927
|
+
/**
|
|
9928
|
+
* 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).
|
|
9929
|
+
*/
|
|
9930
|
+
offset?: OffsetParameter;
|
|
9931
|
+
};
|
|
9932
|
+
|
|
9933
|
+
export type TemplateGetTransactionalEmailSettings200 = {
|
|
9934
|
+
metadata?: CollectionMetadata;
|
|
9935
|
+
items?: TransactionalEmailSetting[];
|
|
9936
|
+
};
|
|
9937
|
+
|
|
9938
|
+
/**
|
|
9939
|
+
* @nullable
|
|
9940
|
+
*/
|
|
9941
|
+
export type TemplateUpdateTransactionalEmailSettingsBody = TransactionalEmailSettingUpdateRequest | null;
|
|
9942
|
+
|
|
9943
|
+
export type TemplateUpdateTransactionalEmailSettings200 = {
|
|
9944
|
+
metadata?: CollectionMetadata;
|
|
9945
|
+
items?: TransactionalEmailSetting[];
|
|
9946
|
+
};
|
|
9947
|
+
|
|
9849
9948
|
export type TemplateGetTemplateEmailsParams = {
|
|
9850
9949
|
/**
|
|
9851
9950
|
* 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.
|
|
@@ -14,12 +14,20 @@ import type {
|
|
|
14
14
|
} from '../../query';
|
|
15
15
|
|
|
16
16
|
import type {
|
|
17
|
+
Template,
|
|
17
18
|
TemplateEmailInstance,
|
|
18
19
|
TemplateGetAllTemplateEmails200,
|
|
19
20
|
TemplateGetAllTemplateEmailsParams,
|
|
21
|
+
TemplateGetAllTemplates200,
|
|
22
|
+
TemplateGetAllTemplatesParams,
|
|
20
23
|
TemplateGetTemplateEmails200,
|
|
21
24
|
TemplateGetTemplateEmailsParams,
|
|
22
|
-
|
|
25
|
+
TemplateGetTransactionalEmailSettings200,
|
|
26
|
+
TemplateGetTransactionalEmailSettingsParams,
|
|
27
|
+
TemplateSendTemplateEmailBody,
|
|
28
|
+
TemplateUpdateTransactionalEmailSettings200,
|
|
29
|
+
TemplateUpdateTransactionalEmailSettingsBody,
|
|
30
|
+
UpdateTemplateRequest
|
|
23
31
|
} from '../outsetaAPI.schemas';
|
|
24
32
|
|
|
25
33
|
import { customFetch } from '../../mutator';
|
|
@@ -29,6 +37,91 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
29
37
|
|
|
30
38
|
|
|
31
39
|
|
|
40
|
+
/**
|
|
41
|
+
* The list holds the templates from Email > Email templates (Tag template), the email
|
|
42
|
+
layouts (Tag layout), the broadcast wrapper (Tag wrapper), the saved support replies
|
|
43
|
+
(Tag savedReply) and the system emails Outseta sends, such as the registration
|
|
44
|
+
confirmation (Tag email). A system email has a SystemName, which never changes. Filter
|
|
45
|
+
with Tag=email or SystemName to find one.
|
|
46
|
+
|
|
47
|
+
Body and Design are left out to keep the list small, except that a system email the
|
|
48
|
+
account never edited carries its default Body. Read a template with the get endpoint to
|
|
49
|
+
see its Body and Design.
|
|
50
|
+
|
|
51
|
+
A system email the account never edited is not stored yet. It is listed with a Uid
|
|
52
|
+
that starts with int_, which can be used like any other Uid. Saving the system email
|
|
53
|
+
stores the account's own copy, which has a regular Uid from then on. An int_ Uid can
|
|
54
|
+
change when Outseta adds system emails, so keep the SystemName rather than the int_ Uid.
|
|
55
|
+
|
|
56
|
+
Internal system emails that accounts cannot change are not listed.
|
|
57
|
+
* @summary The email templates, layouts and system emails of the account.
|
|
58
|
+
*/
|
|
59
|
+
export const templateGetAllTemplates = (
|
|
60
|
+
params?: TemplateGetAllTemplatesParams,
|
|
61
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
62
|
+
) => {
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
return customFetch<TemplateGetAllTemplates200>(
|
|
66
|
+
{url: `/api/v1/templates`, method: 'GET',
|
|
67
|
+
params, signal
|
|
68
|
+
},
|
|
69
|
+
options);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
export const getTemplateGetAllTemplatesQueryKey = (params?: TemplateGetAllTemplatesParams,) => {
|
|
76
|
+
return [
|
|
77
|
+
`/api/v1/templates`, ...(params ? [params]: [])
|
|
78
|
+
] as const;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
export const getTemplateGetAllTemplatesQueryOptions = <TData = Awaited<ReturnType<typeof templateGetAllTemplates>>, TError = void>(params?: TemplateGetAllTemplatesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetAllTemplates>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
83
|
+
) => {
|
|
84
|
+
|
|
85
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
86
|
+
|
|
87
|
+
const queryKey = queryOptions?.queryKey ?? getTemplateGetAllTemplatesQueryKey(params);
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof templateGetAllTemplates>>> = ({ signal }) => templateGetAllTemplates(params, requestOptions, signal);
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof templateGetAllTemplates>>, TError, TData> & { queryKey: QueryKey }
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type TemplateGetAllTemplatesQueryResult = NonNullable<Awaited<ReturnType<typeof templateGetAllTemplates>>>
|
|
101
|
+
export type TemplateGetAllTemplatesQueryError = void
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @summary The email templates, layouts and system emails of the account.
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
export function useTemplateGetAllTemplates<TData = Awaited<ReturnType<typeof templateGetAllTemplates>>, TError = void>(
|
|
109
|
+
params?: TemplateGetAllTemplatesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetAllTemplates>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
110
|
+
|
|
111
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
112
|
+
|
|
113
|
+
const queryOptions = getTemplateGetAllTemplatesQueryOptions(params,options)
|
|
114
|
+
|
|
115
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
116
|
+
|
|
117
|
+
query.queryKey = queryOptions.queryKey ;
|
|
118
|
+
|
|
119
|
+
return query;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
32
125
|
/**
|
|
33
126
|
* Filter with personUid to see what one person was sent, or with templateUid to
|
|
34
127
|
restrict the results to a single template.
|
|
@@ -101,6 +194,144 @@ export function useTemplateGetAllTemplateEmails<TData = Awaited<ReturnType<typeo
|
|
|
101
194
|
|
|
102
195
|
|
|
103
196
|
/**
|
|
197
|
+
* Each setting names the email templates it covers. A setting that is off stops the
|
|
198
|
+
automatic email only; an email sent by hand, such as the send invoice button, is
|
|
199
|
+
still sent.
|
|
200
|
+
* @summary The on/off settings for the transactional emails that Outseta sends to your customers.
|
|
201
|
+
*/
|
|
202
|
+
export const templateGetTransactionalEmailSettings = (
|
|
203
|
+
params?: TemplateGetTransactionalEmailSettingsParams,
|
|
204
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
205
|
+
) => {
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
return customFetch<TemplateGetTransactionalEmailSettings200>(
|
|
209
|
+
{url: `/api/v1/templates/transactional-email-settings`, method: 'GET',
|
|
210
|
+
params, signal
|
|
211
|
+
},
|
|
212
|
+
options);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
export const getTemplateGetTransactionalEmailSettingsQueryKey = (params?: TemplateGetTransactionalEmailSettingsParams,) => {
|
|
219
|
+
return [
|
|
220
|
+
`/api/v1/templates/transactional-email-settings`, ...(params ? [params]: [])
|
|
221
|
+
] as const;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
export const getTemplateGetTransactionalEmailSettingsQueryOptions = <TData = Awaited<ReturnType<typeof templateGetTransactionalEmailSettings>>, TError = void>(params?: TemplateGetTransactionalEmailSettingsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetTransactionalEmailSettings>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
226
|
+
) => {
|
|
227
|
+
|
|
228
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
229
|
+
|
|
230
|
+
const queryKey = queryOptions?.queryKey ?? getTemplateGetTransactionalEmailSettingsQueryKey(params);
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof templateGetTransactionalEmailSettings>>> = ({ signal }) => templateGetTransactionalEmailSettings(params, requestOptions, signal);
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof templateGetTransactionalEmailSettings>>, TError, TData> & { queryKey: QueryKey }
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export type TemplateGetTransactionalEmailSettingsQueryResult = NonNullable<Awaited<ReturnType<typeof templateGetTransactionalEmailSettings>>>
|
|
244
|
+
export type TemplateGetTransactionalEmailSettingsQueryError = void
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @summary The on/off settings for the transactional emails that Outseta sends to your customers.
|
|
249
|
+
*/
|
|
250
|
+
|
|
251
|
+
export function useTemplateGetTransactionalEmailSettings<TData = Awaited<ReturnType<typeof templateGetTransactionalEmailSettings>>, TError = void>(
|
|
252
|
+
params?: TemplateGetTransactionalEmailSettingsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetTransactionalEmailSettings>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
253
|
+
|
|
254
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
255
|
+
|
|
256
|
+
const queryOptions = getTemplateGetTransactionalEmailSettingsQueryOptions(params,options)
|
|
257
|
+
|
|
258
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
259
|
+
|
|
260
|
+
query.queryKey = queryOptions.queryKey ;
|
|
261
|
+
|
|
262
|
+
return query;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Send an object with a Settings list. Each item has Key and IsEnabled. A setting that
|
|
270
|
+
is not in the list keeps its state. Each change is recorded in the activity log.
|
|
271
|
+
Returns all settings.
|
|
272
|
+
* @summary Turns transactional emails on or off.
|
|
273
|
+
*/
|
|
274
|
+
export const templateUpdateTransactionalEmailSettings = (
|
|
275
|
+
templateUpdateTransactionalEmailSettingsBody: TemplateUpdateTransactionalEmailSettingsBody,
|
|
276
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
return customFetch<TemplateUpdateTransactionalEmailSettings200>(
|
|
280
|
+
{url: `/api/v1/templates/transactional-email-settings`, method: 'PUT',
|
|
281
|
+
headers: {'Content-Type': 'application/json', },
|
|
282
|
+
data: templateUpdateTransactionalEmailSettingsBody
|
|
283
|
+
},
|
|
284
|
+
options);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
export const getTemplateUpdateTransactionalEmailSettingsMutationOptions = <TError = void,
|
|
290
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof templateUpdateTransactionalEmailSettings>>, TError,{data: TemplateUpdateTransactionalEmailSettingsBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
291
|
+
): UseMutationOptions<Awaited<ReturnType<typeof templateUpdateTransactionalEmailSettings>>, TError,{data: TemplateUpdateTransactionalEmailSettingsBody}, TContext> => {
|
|
292
|
+
|
|
293
|
+
const mutationKey = ['templateUpdateTransactionalEmailSettings'];
|
|
294
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
295
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
296
|
+
options
|
|
297
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
298
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof templateUpdateTransactionalEmailSettings>>, {data: TemplateUpdateTransactionalEmailSettingsBody}> = (props) => {
|
|
304
|
+
const {data} = props ?? {};
|
|
305
|
+
|
|
306
|
+
return templateUpdateTransactionalEmailSettings(data,requestOptions)
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
return { mutationFn, ...mutationOptions }}
|
|
313
|
+
|
|
314
|
+
export type TemplateUpdateTransactionalEmailSettingsMutationResult = NonNullable<Awaited<ReturnType<typeof templateUpdateTransactionalEmailSettings>>>
|
|
315
|
+
export type TemplateUpdateTransactionalEmailSettingsMutationBody = TemplateUpdateTransactionalEmailSettingsBody
|
|
316
|
+
export type TemplateUpdateTransactionalEmailSettingsMutationError = void
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* @summary Turns transactional emails on or off.
|
|
320
|
+
*/
|
|
321
|
+
export const useTemplateUpdateTransactionalEmailSettings = <TError = void,
|
|
322
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof templateUpdateTransactionalEmailSettings>>, TError,{data: TemplateUpdateTransactionalEmailSettingsBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
323
|
+
): UseMutationResult<
|
|
324
|
+
Awaited<ReturnType<typeof templateUpdateTransactionalEmailSettings>>,
|
|
325
|
+
TError,
|
|
326
|
+
{data: TemplateUpdateTransactionalEmailSettingsBody},
|
|
327
|
+
TContext
|
|
328
|
+
> => {
|
|
329
|
+
|
|
330
|
+
const mutationOptions = getTemplateUpdateTransactionalEmailSettingsMutationOptions(options);
|
|
331
|
+
|
|
332
|
+
return useMutation(mutationOptions);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
104
335
|
* Add personUid to the query string to see what one person was sent from this
|
|
105
336
|
template.
|
|
106
337
|
* @summary The one-off emails that were sent from this email template.
|
|
@@ -176,6 +407,170 @@ export function useTemplateGetTemplateEmails<TData = Awaited<ReturnType<typeof t
|
|
|
176
407
|
|
|
177
408
|
|
|
178
409
|
/**
|
|
410
|
+
* Body is the HTML of the email; Subject and Body may use Liquid tokens such as
|
|
411
|
+
{{ Person.FirstName }}. AvailableTokens lists the tokens Outseta fills in for a system
|
|
412
|
+
email, and RequiredTokens the ones its Body must keep (for example ConfirmationUrl in the
|
|
413
|
+
registration confirmation).
|
|
414
|
+
|
|
415
|
+
Design is the drag-and-drop editor's design of the template as JSON, or null for a
|
|
416
|
+
template that is plain HTML. System emails have no Design.
|
|
417
|
+
|
|
418
|
+
A system email the account never edited returns its default content under its int_ Uid
|
|
419
|
+
from the list endpoint.
|
|
420
|
+
* @summary Get an email template, layout or system email, with its Body and Design.
|
|
421
|
+
*/
|
|
422
|
+
export const templateGetTemplate = (
|
|
423
|
+
templateUid: string | null,
|
|
424
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
425
|
+
) => {
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
return customFetch<Template>(
|
|
429
|
+
{url: `/api/v1/templates/${templateUid}`, method: 'GET', signal
|
|
430
|
+
},
|
|
431
|
+
options);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
export const getTemplateGetTemplateQueryKey = (templateUid?: string | null,) => {
|
|
438
|
+
return [
|
|
439
|
+
`/api/v1/templates/${templateUid}`
|
|
440
|
+
] as const;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
export const getTemplateGetTemplateQueryOptions = <TData = Awaited<ReturnType<typeof templateGetTemplate>>, TError = void>(templateUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetTemplate>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
445
|
+
) => {
|
|
446
|
+
|
|
447
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
448
|
+
|
|
449
|
+
const queryKey = queryOptions?.queryKey ?? getTemplateGetTemplateQueryKey(templateUid);
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof templateGetTemplate>>> = ({ signal }) => templateGetTemplate(templateUid, requestOptions, signal);
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
return { queryKey, queryFn, enabled: !!(templateUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof templateGetTemplate>>, TError, TData> & { queryKey: QueryKey }
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export type TemplateGetTemplateQueryResult = NonNullable<Awaited<ReturnType<typeof templateGetTemplate>>>
|
|
463
|
+
export type TemplateGetTemplateQueryError = void
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* @summary Get an email template, layout or system email, with its Body and Design.
|
|
468
|
+
*/
|
|
469
|
+
|
|
470
|
+
export function useTemplateGetTemplate<TData = Awaited<ReturnType<typeof templateGetTemplate>>, TError = void>(
|
|
471
|
+
templateUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetTemplate>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
472
|
+
|
|
473
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
474
|
+
|
|
475
|
+
const queryOptions = getTemplateGetTemplateQueryOptions(templateUid,options)
|
|
476
|
+
|
|
477
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
478
|
+
|
|
479
|
+
query.queryKey = queryOptions.queryKey ;
|
|
480
|
+
|
|
481
|
+
return query;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Send only the fields to change, usually Subject and Body. Fields left out of the request
|
|
489
|
+
keep their current values; a field sent as null is cleared. The Uid in the request body
|
|
490
|
+
is ignored.
|
|
491
|
+
|
|
492
|
+
Subject and Body must be valid Liquid, and Body must keep every token in RequiredTokens
|
|
493
|
+
(for example ConfirmationUrl in the registration confirmation); otherwise the update is
|
|
494
|
+
rejected with a validation error. The Name, Description and SystemName of a system email
|
|
495
|
+
cannot be changed.
|
|
496
|
+
|
|
497
|
+
A template with a Design (made in the drag-and-drop editor of Email > Email templates)
|
|
498
|
+
opens in the editor from its Design, not its Body. To change the Body of such a
|
|
499
|
+
template, send Design as null as well: the editor then opens the new Body as HTML.
|
|
500
|
+
Otherwise the editor keeps showing the old design, and saving the template there
|
|
501
|
+
replaces the new Body. System emails have no Design.
|
|
502
|
+
|
|
503
|
+
A system email the account never edited has a Uid that starts with int_. Updating it
|
|
504
|
+
stores the account's own copy, with the default content for the fields left out, and
|
|
505
|
+
returns it with its new Uid. From then on Outseta sends the copy; the int_ Uid
|
|
506
|
+
returns 404.
|
|
507
|
+
|
|
508
|
+
On an Outseta account that is not verified yet, updating a system email pauses all email
|
|
509
|
+
sending of the account, as it does in the Outseta app.
|
|
510
|
+
* @summary Update an email template, layout or system email.
|
|
511
|
+
*/
|
|
512
|
+
export const templateUpdateTemplate = (
|
|
513
|
+
templateUid: string | null,
|
|
514
|
+
updateTemplateRequest: UpdateTemplateRequest,
|
|
515
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
return customFetch<Template>(
|
|
519
|
+
{url: `/api/v1/templates/${templateUid}`, method: 'PUT',
|
|
520
|
+
headers: {'Content-Type': 'application/json', },
|
|
521
|
+
data: updateTemplateRequest
|
|
522
|
+
},
|
|
523
|
+
options);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
export const getTemplateUpdateTemplateMutationOptions = <TError = void,
|
|
529
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof templateUpdateTemplate>>, TError,{templateUid: string | null;data: UpdateTemplateRequest}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
530
|
+
): UseMutationOptions<Awaited<ReturnType<typeof templateUpdateTemplate>>, TError,{templateUid: string | null;data: UpdateTemplateRequest}, TContext> => {
|
|
531
|
+
|
|
532
|
+
const mutationKey = ['templateUpdateTemplate'];
|
|
533
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
534
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
535
|
+
options
|
|
536
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
537
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof templateUpdateTemplate>>, {templateUid: string | null;data: UpdateTemplateRequest}> = (props) => {
|
|
543
|
+
const {templateUid,data} = props ?? {};
|
|
544
|
+
|
|
545
|
+
return templateUpdateTemplate(templateUid,data,requestOptions)
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
return { mutationFn, ...mutationOptions }}
|
|
552
|
+
|
|
553
|
+
export type TemplateUpdateTemplateMutationResult = NonNullable<Awaited<ReturnType<typeof templateUpdateTemplate>>>
|
|
554
|
+
export type TemplateUpdateTemplateMutationBody = UpdateTemplateRequest
|
|
555
|
+
export type TemplateUpdateTemplateMutationError = void
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* @summary Update an email template, layout or system email.
|
|
559
|
+
*/
|
|
560
|
+
export const useTemplateUpdateTemplate = <TError = void,
|
|
561
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof templateUpdateTemplate>>, TError,{templateUid: string | null;data: UpdateTemplateRequest}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
562
|
+
): UseMutationResult<
|
|
563
|
+
Awaited<ReturnType<typeof templateUpdateTemplate>>,
|
|
564
|
+
TError,
|
|
565
|
+
{templateUid: string | null;data: UpdateTemplateRequest},
|
|
566
|
+
TContext
|
|
567
|
+
> => {
|
|
568
|
+
|
|
569
|
+
const mutationOptions = getTemplateUpdateTemplateMutationOptions(options);
|
|
570
|
+
|
|
571
|
+
return useMutation(mutationOptions);
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
179
574
|
* The email is merge-rendered for the person and sent immediately. No broadcast
|
|
180
575
|
is created. People who have bounced, unsubscribed or reported spam are not sent
|
|
181
576
|
the email. Only templates from Email > Email templates can be sent.
|