@outseta/react 0.4.23 → 0.4.25
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 +130 -0
- package/package.json +2 -2
- package/src/generated/email/email.ts +338 -1
- package/src/generated/outsetaAPI.schemas.ts +142 -0
- package/src/generated/template/template.ts +251 -0
package/dist/index.js
CHANGED
|
@@ -2727,6 +2727,119 @@ var useCampaignSendTestCampaignEmail = (options) => {
|
|
|
2727
2727
|
const mutationOptions = getCampaignSendTestCampaignEmailMutationOptions(options);
|
|
2728
2728
|
return useMutation(mutationOptions);
|
|
2729
2729
|
};
|
|
2730
|
+
var emailListGetAllEmailLists = (params, options, signal) => {
|
|
2731
|
+
return customFetch({
|
|
2732
|
+
url: `/api/v1/email/lists`,
|
|
2733
|
+
method: "GET",
|
|
2734
|
+
params,
|
|
2735
|
+
signal
|
|
2736
|
+
}, options);
|
|
2737
|
+
};
|
|
2738
|
+
var getEmailListGetAllEmailListsQueryKey = (params) => {
|
|
2739
|
+
return [
|
|
2740
|
+
`/api/v1/email/lists`,
|
|
2741
|
+
...params ? [params] : []
|
|
2742
|
+
];
|
|
2743
|
+
};
|
|
2744
|
+
var getEmailListGetAllEmailListsQueryOptions = (params, options) => {
|
|
2745
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
2746
|
+
const queryKey = queryOptions?.queryKey ?? getEmailListGetAllEmailListsQueryKey(params);
|
|
2747
|
+
const queryFn = ({ signal }) => emailListGetAllEmailLists(params, requestOptions, signal);
|
|
2748
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
2749
|
+
};
|
|
2750
|
+
function useEmailListGetAllEmailLists(params, options) {
|
|
2751
|
+
const queryOptions = getEmailListGetAllEmailListsQueryOptions(params, options);
|
|
2752
|
+
const query = useQuery(queryOptions);
|
|
2753
|
+
query.queryKey = queryOptions.queryKey;
|
|
2754
|
+
return query;
|
|
2755
|
+
}
|
|
2756
|
+
var emailListAddEmailList = (emailListAddEmailListBody, options, signal) => {
|
|
2757
|
+
return customFetch({
|
|
2758
|
+
url: `/api/v1/email/lists`,
|
|
2759
|
+
method: "POST",
|
|
2760
|
+
headers: { "Content-Type": "application/json" },
|
|
2761
|
+
data: emailListAddEmailListBody,
|
|
2762
|
+
signal
|
|
2763
|
+
}, options);
|
|
2764
|
+
};
|
|
2765
|
+
var getEmailListAddEmailListMutationOptions = (options) => {
|
|
2766
|
+
const mutationKey = ["emailListAddEmailList"];
|
|
2767
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined };
|
|
2768
|
+
const mutationFn = (props) => {
|
|
2769
|
+
const { data } = props ?? {};
|
|
2770
|
+
return emailListAddEmailList(data, requestOptions);
|
|
2771
|
+
};
|
|
2772
|
+
return { mutationFn, ...mutationOptions };
|
|
2773
|
+
};
|
|
2774
|
+
var useEmailListAddEmailList = (options) => {
|
|
2775
|
+
const mutationOptions = getEmailListAddEmailListMutationOptions(options);
|
|
2776
|
+
return useMutation(mutationOptions);
|
|
2777
|
+
};
|
|
2778
|
+
var emailListGetEmailList = (emailListUid, options, signal) => {
|
|
2779
|
+
return customFetch({
|
|
2780
|
+
url: `/api/v1/email/lists/${emailListUid}`,
|
|
2781
|
+
method: "GET",
|
|
2782
|
+
signal
|
|
2783
|
+
}, options);
|
|
2784
|
+
};
|
|
2785
|
+
var getEmailListGetEmailListQueryKey = (emailListUid) => {
|
|
2786
|
+
return [
|
|
2787
|
+
`/api/v1/email/lists/${emailListUid}`
|
|
2788
|
+
];
|
|
2789
|
+
};
|
|
2790
|
+
var getEmailListGetEmailListQueryOptions = (emailListUid, options) => {
|
|
2791
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
2792
|
+
const queryKey = queryOptions?.queryKey ?? getEmailListGetEmailListQueryKey(emailListUid);
|
|
2793
|
+
const queryFn = ({ signal }) => emailListGetEmailList(emailListUid, requestOptions, signal);
|
|
2794
|
+
return { queryKey, queryFn, enabled: !!emailListUid, ...queryOptions };
|
|
2795
|
+
};
|
|
2796
|
+
function useEmailListGetEmailList(emailListUid, options) {
|
|
2797
|
+
const queryOptions = getEmailListGetEmailListQueryOptions(emailListUid, options);
|
|
2798
|
+
const query = useQuery(queryOptions);
|
|
2799
|
+
query.queryKey = queryOptions.queryKey;
|
|
2800
|
+
return query;
|
|
2801
|
+
}
|
|
2802
|
+
var emailListUpdateEmailList = (emailListUid, emailListUpdateEmailListBody, options) => {
|
|
2803
|
+
return customFetch({
|
|
2804
|
+
url: `/api/v1/email/lists/${emailListUid}`,
|
|
2805
|
+
method: "PUT",
|
|
2806
|
+
headers: { "Content-Type": "application/json" },
|
|
2807
|
+
data: emailListUpdateEmailListBody
|
|
2808
|
+
}, options);
|
|
2809
|
+
};
|
|
2810
|
+
var getEmailListUpdateEmailListMutationOptions = (options) => {
|
|
2811
|
+
const mutationKey = ["emailListUpdateEmailList"];
|
|
2812
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined };
|
|
2813
|
+
const mutationFn = (props) => {
|
|
2814
|
+
const { emailListUid, data } = props ?? {};
|
|
2815
|
+
return emailListUpdateEmailList(emailListUid, data, requestOptions);
|
|
2816
|
+
};
|
|
2817
|
+
return { mutationFn, ...mutationOptions };
|
|
2818
|
+
};
|
|
2819
|
+
var useEmailListUpdateEmailList = (options) => {
|
|
2820
|
+
const mutationOptions = getEmailListUpdateEmailListMutationOptions(options);
|
|
2821
|
+
return useMutation(mutationOptions);
|
|
2822
|
+
};
|
|
2823
|
+
var emailListDeleteEmailList = (emailListUid, options) => {
|
|
2824
|
+
return customFetch({
|
|
2825
|
+
url: `/api/v1/email/lists/${emailListUid}`,
|
|
2826
|
+
method: "DELETE",
|
|
2827
|
+
responseType: "blob"
|
|
2828
|
+
}, options);
|
|
2829
|
+
};
|
|
2830
|
+
var getEmailListDeleteEmailListMutationOptions = (options) => {
|
|
2831
|
+
const mutationKey = ["emailListDeleteEmailList"];
|
|
2832
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined };
|
|
2833
|
+
const mutationFn = (props) => {
|
|
2834
|
+
const { emailListUid } = props ?? {};
|
|
2835
|
+
return emailListDeleteEmailList(emailListUid, requestOptions);
|
|
2836
|
+
};
|
|
2837
|
+
return { mutationFn, ...mutationOptions };
|
|
2838
|
+
};
|
|
2839
|
+
var useEmailListDeleteEmailList = (options) => {
|
|
2840
|
+
const mutationOptions = getEmailListDeleteEmailListMutationOptions(options);
|
|
2841
|
+
return useMutation(mutationOptions);
|
|
2842
|
+
};
|
|
2730
2843
|
var emailListGetAllSubscriptions = (emailListUid, params, options, signal) => {
|
|
2731
2844
|
return customFetch({
|
|
2732
2845
|
url: `/api/v1/email/lists/${emailListUid}/subscriptions`,
|
|
@@ -3611,9 +3724,14 @@ export {
|
|
|
3611
3724
|
useInvoiceGetAllInvoices,
|
|
3612
3725
|
useInvoiceDeleteInvoice,
|
|
3613
3726
|
useInvoiceAddInvoice,
|
|
3727
|
+
useEmailListUpdateEmailList,
|
|
3728
|
+
useEmailListGetEmailList,
|
|
3614
3729
|
useEmailListGetAllSubscriptions,
|
|
3730
|
+
useEmailListGetAllEmailLists,
|
|
3615
3731
|
useEmailListDeleteSubscription,
|
|
3732
|
+
useEmailListDeleteEmailList,
|
|
3616
3733
|
useEmailListAddSubscription,
|
|
3734
|
+
useEmailListAddEmailList,
|
|
3617
3735
|
useDripCampaignUpdateDripCampaignMessage,
|
|
3618
3736
|
useDripCampaignUpdateDripCampaign,
|
|
3619
3737
|
useDripCampaignSendTestCampaignEmail,
|
|
@@ -3777,10 +3895,17 @@ export {
|
|
|
3777
3895
|
getInvoiceGetAllInvoicesQueryKey,
|
|
3778
3896
|
getInvoiceDeleteInvoiceMutationOptions,
|
|
3779
3897
|
getInvoiceAddInvoiceMutationOptions,
|
|
3898
|
+
getEmailListUpdateEmailListMutationOptions,
|
|
3899
|
+
getEmailListGetEmailListQueryOptions,
|
|
3900
|
+
getEmailListGetEmailListQueryKey,
|
|
3780
3901
|
getEmailListGetAllSubscriptionsQueryOptions,
|
|
3781
3902
|
getEmailListGetAllSubscriptionsQueryKey,
|
|
3903
|
+
getEmailListGetAllEmailListsQueryOptions,
|
|
3904
|
+
getEmailListGetAllEmailListsQueryKey,
|
|
3782
3905
|
getEmailListDeleteSubscriptionMutationOptions,
|
|
3906
|
+
getEmailListDeleteEmailListMutationOptions,
|
|
3783
3907
|
getEmailListAddSubscriptionMutationOptions,
|
|
3908
|
+
getEmailListAddEmailListMutationOptions,
|
|
3784
3909
|
getDripCampaignUpdateDripCampaignMutationOptions,
|
|
3785
3910
|
getDripCampaignUpdateDripCampaignMessageMutationOptions,
|
|
3786
3911
|
getDripCampaignSendTestCampaignEmailMutationOptions,
|
|
@@ -3853,9 +3978,14 @@ export {
|
|
|
3853
3978
|
getAccountCancelAccountMutationOptions,
|
|
3854
3979
|
getAccountAddPersonToAccountMutationOptions,
|
|
3855
3980
|
getAccountAddAccountMutationOptions,
|
|
3981
|
+
emailListUpdateEmailList,
|
|
3982
|
+
emailListGetEmailList,
|
|
3856
3983
|
emailListGetAllSubscriptions,
|
|
3984
|
+
emailListGetAllEmailLists,
|
|
3857
3985
|
emailListDeleteSubscription,
|
|
3986
|
+
emailListDeleteEmailList,
|
|
3858
3987
|
emailListAddSubscription,
|
|
3988
|
+
emailListAddEmailList,
|
|
3859
3989
|
dripCampaignUpdateDripCampaignMessage,
|
|
3860
3990
|
dripCampaignUpdateDripCampaign,
|
|
3861
3991
|
dripCampaignSendTestCampaignEmail,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outseta/react",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.25",
|
|
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.3.
|
|
21
|
+
"@outseta/api-client": "0.3.31"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^18.0.0 || ^19.0.0"
|
|
@@ -29,10 +29,15 @@ import type {
|
|
|
29
29
|
DripCampaignSendTestCampaignEmailBody,
|
|
30
30
|
DripCampaignUpdateDripCampaignBody,
|
|
31
31
|
DripCampaignUpdateDripCampaignMessageBody,
|
|
32
|
+
EmailList,
|
|
33
|
+
EmailListAddEmailListBody,
|
|
32
34
|
EmailListAddSubscriptionBody,
|
|
35
|
+
EmailListGetAllEmailLists200,
|
|
36
|
+
EmailListGetAllEmailListsParams,
|
|
33
37
|
EmailListGetAllSubscriptions200,
|
|
34
38
|
EmailListGetAllSubscriptionsParams,
|
|
35
|
-
EmailListPerson
|
|
39
|
+
EmailListPerson,
|
|
40
|
+
EmailListUpdateEmailListBody
|
|
36
41
|
} from '../outsetaAPI.schemas';
|
|
37
42
|
|
|
38
43
|
import { customFetch } from '../../mutator';
|
|
@@ -1319,6 +1324,338 @@ export const useCampaignSendTestCampaignEmail = <TError = void,
|
|
|
1319
1324
|
return useMutation(mutationOptions);
|
|
1320
1325
|
}
|
|
1321
1326
|
/**
|
|
1327
|
+
* @summary Retrieve all email lists.
|
|
1328
|
+
*/
|
|
1329
|
+
export const emailListGetAllEmailLists = (
|
|
1330
|
+
params?: EmailListGetAllEmailListsParams,
|
|
1331
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1332
|
+
) => {
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
return customFetch<EmailListGetAllEmailLists200>(
|
|
1336
|
+
{url: `/api/v1/email/lists`, method: 'GET',
|
|
1337
|
+
params, signal
|
|
1338
|
+
},
|
|
1339
|
+
options);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
export const getEmailListGetAllEmailListsQueryKey = (params?: EmailListGetAllEmailListsParams,) => {
|
|
1346
|
+
return [
|
|
1347
|
+
`/api/v1/email/lists`, ...(params ? [params]: [])
|
|
1348
|
+
] as const;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
export const getEmailListGetAllEmailListsQueryOptions = <TData = Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError = void>(params?: EmailListGetAllEmailListsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1353
|
+
) => {
|
|
1354
|
+
|
|
1355
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1356
|
+
|
|
1357
|
+
const queryKey = queryOptions?.queryKey ?? getEmailListGetAllEmailListsQueryKey(params);
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof emailListGetAllEmailLists>>> = ({ signal }) => emailListGetAllEmailLists(params, requestOptions, signal);
|
|
1362
|
+
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
|
|
1367
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError, TData> & { queryKey: QueryKey }
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
export type EmailListGetAllEmailListsQueryResult = NonNullable<Awaited<ReturnType<typeof emailListGetAllEmailLists>>>
|
|
1371
|
+
export type EmailListGetAllEmailListsQueryError = void
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* @summary Retrieve all email lists.
|
|
1376
|
+
*/
|
|
1377
|
+
|
|
1378
|
+
export function useEmailListGetAllEmailLists<TData = Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError = void>(
|
|
1379
|
+
params?: EmailListGetAllEmailListsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1380
|
+
|
|
1381
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1382
|
+
|
|
1383
|
+
const queryOptions = getEmailListGetAllEmailListsQueryOptions(params,options)
|
|
1384
|
+
|
|
1385
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1386
|
+
|
|
1387
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1388
|
+
|
|
1389
|
+
return query;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* Name is required and must be unique. Set RequiresDoubleOptIn to true to require new
|
|
1397
|
+
subscribers to confirm their subscription. WelcomeSubject and WelcomeBody configure an
|
|
1398
|
+
optional welcome email; use WelcomeFromName and WelcomeFromEmail to set its sender.
|
|
1399
|
+
* @summary Create an email list.
|
|
1400
|
+
*/
|
|
1401
|
+
export const emailListAddEmailList = (
|
|
1402
|
+
emailListAddEmailListBody: NonReadonly<EmailListAddEmailListBody>,
|
|
1403
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1404
|
+
) => {
|
|
1405
|
+
|
|
1406
|
+
|
|
1407
|
+
return customFetch<EmailList>(
|
|
1408
|
+
{url: `/api/v1/email/lists`, method: 'POST',
|
|
1409
|
+
headers: {'Content-Type': 'application/json', },
|
|
1410
|
+
data: emailListAddEmailListBody, signal
|
|
1411
|
+
},
|
|
1412
|
+
options);
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
export const getEmailListAddEmailListMutationOptions = <TError = void,
|
|
1418
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListAddEmailList>>, TError,{data: NonReadonly<EmailListAddEmailListBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1419
|
+
): UseMutationOptions<Awaited<ReturnType<typeof emailListAddEmailList>>, TError,{data: NonReadonly<EmailListAddEmailListBody>}, TContext> => {
|
|
1420
|
+
|
|
1421
|
+
const mutationKey = ['emailListAddEmailList'];
|
|
1422
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1423
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1424
|
+
options
|
|
1425
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1426
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1427
|
+
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof emailListAddEmailList>>, {data: NonReadonly<EmailListAddEmailListBody>}> = (props) => {
|
|
1432
|
+
const {data} = props ?? {};
|
|
1433
|
+
|
|
1434
|
+
return emailListAddEmailList(data,requestOptions)
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
|
|
1440
|
+
return { mutationFn, ...mutationOptions }}
|
|
1441
|
+
|
|
1442
|
+
export type EmailListAddEmailListMutationResult = NonNullable<Awaited<ReturnType<typeof emailListAddEmailList>>>
|
|
1443
|
+
export type EmailListAddEmailListMutationBody = NonReadonly<EmailListAddEmailListBody>
|
|
1444
|
+
export type EmailListAddEmailListMutationError = void
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* @summary Create an email list.
|
|
1448
|
+
*/
|
|
1449
|
+
export const useEmailListAddEmailList = <TError = void,
|
|
1450
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListAddEmailList>>, TError,{data: NonReadonly<EmailListAddEmailListBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1451
|
+
): UseMutationResult<
|
|
1452
|
+
Awaited<ReturnType<typeof emailListAddEmailList>>,
|
|
1453
|
+
TError,
|
|
1454
|
+
{data: NonReadonly<EmailListAddEmailListBody>},
|
|
1455
|
+
TContext
|
|
1456
|
+
> => {
|
|
1457
|
+
|
|
1458
|
+
const mutationOptions = getEmailListAddEmailListMutationOptions(options);
|
|
1459
|
+
|
|
1460
|
+
return useMutation(mutationOptions);
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* @summary Retrieve an email list.
|
|
1464
|
+
*/
|
|
1465
|
+
export const emailListGetEmailList = (
|
|
1466
|
+
emailListUid: string | null,
|
|
1467
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1468
|
+
) => {
|
|
1469
|
+
|
|
1470
|
+
|
|
1471
|
+
return customFetch<EmailList>(
|
|
1472
|
+
{url: `/api/v1/email/lists/${emailListUid}`, method: 'GET', signal
|
|
1473
|
+
},
|
|
1474
|
+
options);
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
export const getEmailListGetEmailListQueryKey = (emailListUid?: string | null,) => {
|
|
1481
|
+
return [
|
|
1482
|
+
`/api/v1/email/lists/${emailListUid}`
|
|
1483
|
+
] as const;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
export const getEmailListGetEmailListQueryOptions = <TData = Awaited<ReturnType<typeof emailListGetEmailList>>, TError = void>(emailListUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof emailListGetEmailList>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1488
|
+
) => {
|
|
1489
|
+
|
|
1490
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1491
|
+
|
|
1492
|
+
const queryKey = queryOptions?.queryKey ?? getEmailListGetEmailListQueryKey(emailListUid);
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof emailListGetEmailList>>> = ({ signal }) => emailListGetEmailList(emailListUid, requestOptions, signal);
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
return { queryKey, queryFn, enabled: !!(emailListUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof emailListGetEmailList>>, TError, TData> & { queryKey: QueryKey }
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
export type EmailListGetEmailListQueryResult = NonNullable<Awaited<ReturnType<typeof emailListGetEmailList>>>
|
|
1506
|
+
export type EmailListGetEmailListQueryError = void
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
/**
|
|
1510
|
+
* @summary Retrieve an email list.
|
|
1511
|
+
*/
|
|
1512
|
+
|
|
1513
|
+
export function useEmailListGetEmailList<TData = Awaited<ReturnType<typeof emailListGetEmailList>>, TError = void>(
|
|
1514
|
+
emailListUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof emailListGetEmailList>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1515
|
+
|
|
1516
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1517
|
+
|
|
1518
|
+
const queryOptions = getEmailListGetEmailListQueryOptions(emailListUid,options)
|
|
1519
|
+
|
|
1520
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1521
|
+
|
|
1522
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1523
|
+
|
|
1524
|
+
return query;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
/**
|
|
1531
|
+
* The Uid may be omitted from the request body. If supplied, it must match the Uid in the URL.
|
|
1532
|
+
* @summary Update an email list.
|
|
1533
|
+
*/
|
|
1534
|
+
export const emailListUpdateEmailList = (
|
|
1535
|
+
emailListUid: string | null,
|
|
1536
|
+
emailListUpdateEmailListBody: NonReadonly<EmailListUpdateEmailListBody>,
|
|
1537
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
return customFetch<EmailList>(
|
|
1541
|
+
{url: `/api/v1/email/lists/${emailListUid}`, method: 'PUT',
|
|
1542
|
+
headers: {'Content-Type': 'application/json', },
|
|
1543
|
+
data: emailListUpdateEmailListBody
|
|
1544
|
+
},
|
|
1545
|
+
options);
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
export const getEmailListUpdateEmailListMutationOptions = <TError = void,
|
|
1551
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListUpdateEmailList>>, TError,{emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1552
|
+
): UseMutationOptions<Awaited<ReturnType<typeof emailListUpdateEmailList>>, TError,{emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>}, TContext> => {
|
|
1553
|
+
|
|
1554
|
+
const mutationKey = ['emailListUpdateEmailList'];
|
|
1555
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1556
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1557
|
+
options
|
|
1558
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1559
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1560
|
+
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof emailListUpdateEmailList>>, {emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>}> = (props) => {
|
|
1565
|
+
const {emailListUid,data} = props ?? {};
|
|
1566
|
+
|
|
1567
|
+
return emailListUpdateEmailList(emailListUid,data,requestOptions)
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
|
|
1572
|
+
|
|
1573
|
+
return { mutationFn, ...mutationOptions }}
|
|
1574
|
+
|
|
1575
|
+
export type EmailListUpdateEmailListMutationResult = NonNullable<Awaited<ReturnType<typeof emailListUpdateEmailList>>>
|
|
1576
|
+
export type EmailListUpdateEmailListMutationBody = NonReadonly<EmailListUpdateEmailListBody>
|
|
1577
|
+
export type EmailListUpdateEmailListMutationError = void
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* @summary Update an email list.
|
|
1581
|
+
*/
|
|
1582
|
+
export const useEmailListUpdateEmailList = <TError = void,
|
|
1583
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListUpdateEmailList>>, TError,{emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1584
|
+
): UseMutationResult<
|
|
1585
|
+
Awaited<ReturnType<typeof emailListUpdateEmailList>>,
|
|
1586
|
+
TError,
|
|
1587
|
+
{emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>},
|
|
1588
|
+
TContext
|
|
1589
|
+
> => {
|
|
1590
|
+
|
|
1591
|
+
const mutationOptions = getEmailListUpdateEmailListMutationOptions(options);
|
|
1592
|
+
|
|
1593
|
+
return useMutation(mutationOptions);
|
|
1594
|
+
}
|
|
1595
|
+
/**
|
|
1596
|
+
* Deleting a list also removes all of its subscriptions.
|
|
1597
|
+
* @summary Delete an email list.
|
|
1598
|
+
*/
|
|
1599
|
+
export const emailListDeleteEmailList = (
|
|
1600
|
+
emailListUid: string | null,
|
|
1601
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
return customFetch<Blob>(
|
|
1605
|
+
{url: `/api/v1/email/lists/${emailListUid}`, method: 'DELETE',
|
|
1606
|
+
responseType: 'blob'
|
|
1607
|
+
},
|
|
1608
|
+
options);
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
|
|
1612
|
+
|
|
1613
|
+
export const getEmailListDeleteEmailListMutationOptions = <TError = void,
|
|
1614
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListDeleteEmailList>>, TError,{emailListUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1615
|
+
): UseMutationOptions<Awaited<ReturnType<typeof emailListDeleteEmailList>>, TError,{emailListUid: string | null}, TContext> => {
|
|
1616
|
+
|
|
1617
|
+
const mutationKey = ['emailListDeleteEmailList'];
|
|
1618
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1619
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1620
|
+
options
|
|
1621
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1622
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
|
|
1627
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof emailListDeleteEmailList>>, {emailListUid: string | null}> = (props) => {
|
|
1628
|
+
const {emailListUid} = props ?? {};
|
|
1629
|
+
|
|
1630
|
+
return emailListDeleteEmailList(emailListUid,requestOptions)
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
|
|
1635
|
+
|
|
1636
|
+
return { mutationFn, ...mutationOptions }}
|
|
1637
|
+
|
|
1638
|
+
export type EmailListDeleteEmailListMutationResult = NonNullable<Awaited<ReturnType<typeof emailListDeleteEmailList>>>
|
|
1639
|
+
|
|
1640
|
+
export type EmailListDeleteEmailListMutationError = void
|
|
1641
|
+
|
|
1642
|
+
/**
|
|
1643
|
+
* @summary Delete an email list.
|
|
1644
|
+
*/
|
|
1645
|
+
export const useEmailListDeleteEmailList = <TError = void,
|
|
1646
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListDeleteEmailList>>, TError,{emailListUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1647
|
+
): UseMutationResult<
|
|
1648
|
+
Awaited<ReturnType<typeof emailListDeleteEmailList>>,
|
|
1649
|
+
TError,
|
|
1650
|
+
{emailListUid: string | null},
|
|
1651
|
+
TContext
|
|
1652
|
+
> => {
|
|
1653
|
+
|
|
1654
|
+
const mutationOptions = getEmailListDeleteEmailListMutationOptions(options);
|
|
1655
|
+
|
|
1656
|
+
return useMutation(mutationOptions);
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1322
1659
|
* @summary Retrieve all subscribers to an email list.
|
|
1323
1660
|
*/
|
|
1324
1661
|
export const emailListGetAllSubscriptions = (
|
|
@@ -3658,6 +3658,62 @@ export const ActivityType = {
|
|
|
3658
3658
|
DiscordUserRemovedFromServer: 503,
|
|
3659
3659
|
} as const;
|
|
3660
3660
|
|
|
3661
|
+
/**
|
|
3662
|
+
* @nullable
|
|
3663
|
+
*/
|
|
3664
|
+
export type TemplateEmailInstanceAllOfTemplate = Template | null;
|
|
3665
|
+
|
|
3666
|
+
/**
|
|
3667
|
+
* @nullable
|
|
3668
|
+
*/
|
|
3669
|
+
export type TemplateEmailInstanceAllOfRecipient = Person | null;
|
|
3670
|
+
|
|
3671
|
+
export type TemplateEmailInstanceAllOf = {
|
|
3672
|
+
/** @nullable */
|
|
3673
|
+
Template?: TemplateEmailInstanceAllOfTemplate;
|
|
3674
|
+
/** @nullable */
|
|
3675
|
+
Recipient?: TemplateEmailInstanceAllOfRecipient;
|
|
3676
|
+
/**
|
|
3677
|
+
* @maxLength 50
|
|
3678
|
+
* @nullable
|
|
3679
|
+
*/
|
|
3680
|
+
UniqueMessageId?: string | null;
|
|
3681
|
+
/**
|
|
3682
|
+
* @maxLength 1000
|
|
3683
|
+
* @nullable
|
|
3684
|
+
*/
|
|
3685
|
+
Subject?: string | null;
|
|
3686
|
+
/**
|
|
3687
|
+
* @maxLength 250
|
|
3688
|
+
* @nullable
|
|
3689
|
+
*/
|
|
3690
|
+
FromEmail?: string | null;
|
|
3691
|
+
/**
|
|
3692
|
+
* @maxLength 250
|
|
3693
|
+
* @nullable
|
|
3694
|
+
*/
|
|
3695
|
+
FromName?: string | null;
|
|
3696
|
+
SendDateTime?: string;
|
|
3697
|
+
/** @nullable */
|
|
3698
|
+
ProcessDateTime?: string | null;
|
|
3699
|
+
/** @nullable */
|
|
3700
|
+
DeliverDateTime?: string | null;
|
|
3701
|
+
/** @nullable */
|
|
3702
|
+
BounceDateTime?: string | null;
|
|
3703
|
+
/** @nullable */
|
|
3704
|
+
SpamDateTime?: string | null;
|
|
3705
|
+
/** @nullable */
|
|
3706
|
+
OpenDateTime?: string | null;
|
|
3707
|
+
/** @nullable */
|
|
3708
|
+
ClickDateTime?: string | null;
|
|
3709
|
+
/** @nullable */
|
|
3710
|
+
UnsubscribeDateTime?: string | null;
|
|
3711
|
+
/** @nullable */
|
|
3712
|
+
SendError?: string | null;
|
|
3713
|
+
};
|
|
3714
|
+
|
|
3715
|
+
export type TemplateEmailInstance = AbstractQcountBean & TemplateEmailInstanceAllOf;
|
|
3716
|
+
|
|
3661
3717
|
export type TemplateAllOf = {
|
|
3662
3718
|
/**
|
|
3663
3719
|
* @minLength 1
|
|
@@ -3694,6 +3750,29 @@ export type TemplateAllOf = {
|
|
|
3694
3750
|
|
|
3695
3751
|
export type Template = AbstractQcountBean & TemplateAllOf;
|
|
3696
3752
|
|
|
3753
|
+
export interface SendTemplateEmailRequest {
|
|
3754
|
+
/**
|
|
3755
|
+
* The Uid of the person to send the email to. Required.
|
|
3756
|
+
* @nullable
|
|
3757
|
+
*/
|
|
3758
|
+
PersonUid?: string | null;
|
|
3759
|
+
/**
|
|
3760
|
+
* The from address. Defaults to the support email address for the account.
|
|
3761
|
+
* @nullable
|
|
3762
|
+
*/
|
|
3763
|
+
FromEmail?: string | null;
|
|
3764
|
+
/**
|
|
3765
|
+
* The from name. Defaults to the company name.
|
|
3766
|
+
* @nullable
|
|
3767
|
+
*/
|
|
3768
|
+
FromName?: string | null;
|
|
3769
|
+
/**
|
|
3770
|
+
* Overrides the subject of the template.
|
|
3771
|
+
* @nullable
|
|
3772
|
+
*/
|
|
3773
|
+
Subject?: string | null;
|
|
3774
|
+
}
|
|
3775
|
+
|
|
3697
3776
|
export type SendGridDomainAuthenticationAllOf = {
|
|
3698
3777
|
/**
|
|
3699
3778
|
* @minLength 1
|
|
@@ -9185,6 +9264,43 @@ export type CategoryGetAllCategories200 = {
|
|
|
9185
9264
|
items?: Category[];
|
|
9186
9265
|
};
|
|
9187
9266
|
|
|
9267
|
+
export type TemplateGetAllTemplateEmailsParams = {
|
|
9268
|
+
/**
|
|
9269
|
+
* 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.
|
|
9270
|
+
*/
|
|
9271
|
+
limit?: LimitParameter;
|
|
9272
|
+
/**
|
|
9273
|
+
* 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).
|
|
9274
|
+
*/
|
|
9275
|
+
offset?: OffsetParameter;
|
|
9276
|
+
};
|
|
9277
|
+
|
|
9278
|
+
export type TemplateGetAllTemplateEmails200 = {
|
|
9279
|
+
metadata?: CollectionMetadata;
|
|
9280
|
+
items?: TemplateEmailInstance[];
|
|
9281
|
+
};
|
|
9282
|
+
|
|
9283
|
+
export type TemplateGetTemplateEmailsParams = {
|
|
9284
|
+
/**
|
|
9285
|
+
* 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.
|
|
9286
|
+
*/
|
|
9287
|
+
limit?: LimitParameter;
|
|
9288
|
+
/**
|
|
9289
|
+
* 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).
|
|
9290
|
+
*/
|
|
9291
|
+
offset?: OffsetParameter;
|
|
9292
|
+
};
|
|
9293
|
+
|
|
9294
|
+
export type TemplateGetTemplateEmails200 = {
|
|
9295
|
+
metadata?: CollectionMetadata;
|
|
9296
|
+
items?: TemplateEmailInstance[];
|
|
9297
|
+
};
|
|
9298
|
+
|
|
9299
|
+
/**
|
|
9300
|
+
* @nullable
|
|
9301
|
+
*/
|
|
9302
|
+
export type TemplateSendTemplateEmailBody = SendTemplateEmailRequest | null;
|
|
9303
|
+
|
|
9188
9304
|
export type DripCampaignGetAllDripCampaignsParams = {
|
|
9189
9305
|
/**
|
|
9190
9306
|
* 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.
|
|
@@ -9257,6 +9373,32 @@ export type CampaignUpdateBroadcastEmailBody = BroadcastCampaign | null;
|
|
|
9257
9373
|
*/
|
|
9258
9374
|
export type CampaignSendTestCampaignEmailBody = SendTestEmailRequest2 | null;
|
|
9259
9375
|
|
|
9376
|
+
export type EmailListGetAllEmailListsParams = {
|
|
9377
|
+
/**
|
|
9378
|
+
* 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.
|
|
9379
|
+
*/
|
|
9380
|
+
limit?: LimitParameter;
|
|
9381
|
+
/**
|
|
9382
|
+
* 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).
|
|
9383
|
+
*/
|
|
9384
|
+
offset?: OffsetParameter;
|
|
9385
|
+
};
|
|
9386
|
+
|
|
9387
|
+
export type EmailListGetAllEmailLists200 = {
|
|
9388
|
+
metadata?: CollectionMetadata;
|
|
9389
|
+
items?: EmailList[];
|
|
9390
|
+
};
|
|
9391
|
+
|
|
9392
|
+
/**
|
|
9393
|
+
* @nullable
|
|
9394
|
+
*/
|
|
9395
|
+
export type EmailListAddEmailListBody = EmailList | null;
|
|
9396
|
+
|
|
9397
|
+
/**
|
|
9398
|
+
* @nullable
|
|
9399
|
+
*/
|
|
9400
|
+
export type EmailListUpdateEmailListBody = EmailList | null;
|
|
9401
|
+
|
|
9260
9402
|
export type EmailListGetAllSubscriptionsParams = {
|
|
9261
9403
|
/**
|
|
9262
9404
|
* Matches person's first name or last name or email address.
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import {
|
|
3
|
+
useMutation,
|
|
4
|
+
useQuery
|
|
5
|
+
} from '../../query';
|
|
6
|
+
import type {
|
|
7
|
+
MutationFunction,
|
|
8
|
+
QueryFunction,
|
|
9
|
+
QueryKey,
|
|
10
|
+
UseMutationOptions,
|
|
11
|
+
UseMutationResult,
|
|
12
|
+
UseQueryOptions,
|
|
13
|
+
UseQueryResult
|
|
14
|
+
} from '../../query';
|
|
15
|
+
|
|
16
|
+
import type {
|
|
17
|
+
TemplateEmailInstance,
|
|
18
|
+
TemplateGetAllTemplateEmails200,
|
|
19
|
+
TemplateGetAllTemplateEmailsParams,
|
|
20
|
+
TemplateGetTemplateEmails200,
|
|
21
|
+
TemplateGetTemplateEmailsParams,
|
|
22
|
+
TemplateSendTemplateEmailBody
|
|
23
|
+
} from '../outsetaAPI.schemas';
|
|
24
|
+
|
|
25
|
+
import { customFetch } from '../../mutator';
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Filter with personUid to see what one person was sent, or with templateUid to
|
|
34
|
+
restrict the results to a single template.
|
|
35
|
+
* @summary The one-off emails that were sent from any email template.
|
|
36
|
+
*/
|
|
37
|
+
export const templateGetAllTemplateEmails = (
|
|
38
|
+
params?: TemplateGetAllTemplateEmailsParams,
|
|
39
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
40
|
+
) => {
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
return customFetch<TemplateGetAllTemplateEmails200>(
|
|
44
|
+
{url: `/api/v1/templates/emails`, method: 'GET',
|
|
45
|
+
params, signal
|
|
46
|
+
},
|
|
47
|
+
options);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export const getTemplateGetAllTemplateEmailsQueryKey = (params?: TemplateGetAllTemplateEmailsParams,) => {
|
|
54
|
+
return [
|
|
55
|
+
`/api/v1/templates/emails`, ...(params ? [params]: [])
|
|
56
|
+
] as const;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export const getTemplateGetAllTemplateEmailsQueryOptions = <TData = Awaited<ReturnType<typeof templateGetAllTemplateEmails>>, TError = void>(params?: TemplateGetAllTemplateEmailsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetAllTemplateEmails>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
61
|
+
) => {
|
|
62
|
+
|
|
63
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
64
|
+
|
|
65
|
+
const queryKey = queryOptions?.queryKey ?? getTemplateGetAllTemplateEmailsQueryKey(params);
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof templateGetAllTemplateEmails>>> = ({ signal }) => templateGetAllTemplateEmails(params, requestOptions, signal);
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof templateGetAllTemplateEmails>>, TError, TData> & { queryKey: QueryKey }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type TemplateGetAllTemplateEmailsQueryResult = NonNullable<Awaited<ReturnType<typeof templateGetAllTemplateEmails>>>
|
|
79
|
+
export type TemplateGetAllTemplateEmailsQueryError = void
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @summary The one-off emails that were sent from any email template.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
export function useTemplateGetAllTemplateEmails<TData = Awaited<ReturnType<typeof templateGetAllTemplateEmails>>, TError = void>(
|
|
87
|
+
params?: TemplateGetAllTemplateEmailsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetAllTemplateEmails>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
88
|
+
|
|
89
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
90
|
+
|
|
91
|
+
const queryOptions = getTemplateGetAllTemplateEmailsQueryOptions(params,options)
|
|
92
|
+
|
|
93
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
94
|
+
|
|
95
|
+
query.queryKey = queryOptions.queryKey ;
|
|
96
|
+
|
|
97
|
+
return query;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Add personUid to the query string to see what one person was sent from this
|
|
105
|
+
template.
|
|
106
|
+
* @summary The one-off emails that were sent from this email template.
|
|
107
|
+
*/
|
|
108
|
+
export const templateGetTemplateEmails = (
|
|
109
|
+
templateUid: string | null,
|
|
110
|
+
params?: TemplateGetTemplateEmailsParams,
|
|
111
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
112
|
+
) => {
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
return customFetch<TemplateGetTemplateEmails200>(
|
|
116
|
+
{url: `/api/v1/templates/${templateUid}/emails`, method: 'GET',
|
|
117
|
+
params, signal
|
|
118
|
+
},
|
|
119
|
+
options);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
export const getTemplateGetTemplateEmailsQueryKey = (templateUid?: string | null,
|
|
126
|
+
params?: TemplateGetTemplateEmailsParams,) => {
|
|
127
|
+
return [
|
|
128
|
+
`/api/v1/templates/${templateUid}/emails`, ...(params ? [params]: [])
|
|
129
|
+
] as const;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
export const getTemplateGetTemplateEmailsQueryOptions = <TData = Awaited<ReturnType<typeof templateGetTemplateEmails>>, TError = void>(templateUid: string | null,
|
|
134
|
+
params?: TemplateGetTemplateEmailsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetTemplateEmails>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
135
|
+
) => {
|
|
136
|
+
|
|
137
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
138
|
+
|
|
139
|
+
const queryKey = queryOptions?.queryKey ?? getTemplateGetTemplateEmailsQueryKey(templateUid,params);
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof templateGetTemplateEmails>>> = ({ signal }) => templateGetTemplateEmails(templateUid,params, requestOptions, signal);
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
return { queryKey, queryFn, enabled: !!(templateUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof templateGetTemplateEmails>>, TError, TData> & { queryKey: QueryKey }
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export type TemplateGetTemplateEmailsQueryResult = NonNullable<Awaited<ReturnType<typeof templateGetTemplateEmails>>>
|
|
153
|
+
export type TemplateGetTemplateEmailsQueryError = void
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @summary The one-off emails that were sent from this email template.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
export function useTemplateGetTemplateEmails<TData = Awaited<ReturnType<typeof templateGetTemplateEmails>>, TError = void>(
|
|
161
|
+
templateUid: string | null,
|
|
162
|
+
params?: TemplateGetTemplateEmailsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof templateGetTemplateEmails>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
163
|
+
|
|
164
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
165
|
+
|
|
166
|
+
const queryOptions = getTemplateGetTemplateEmailsQueryOptions(templateUid,params,options)
|
|
167
|
+
|
|
168
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
169
|
+
|
|
170
|
+
query.queryKey = queryOptions.queryKey ;
|
|
171
|
+
|
|
172
|
+
return query;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The email is merge-rendered for the person and sent immediately. No broadcast
|
|
180
|
+
is created. People who have bounced, unsubscribed or reported spam are not sent
|
|
181
|
+
the email. Only templates from Email > Email templates can be sent.
|
|
182
|
+
|
|
183
|
+
The response holds the record of the send. Read the open and click analytics
|
|
184
|
+
for it later from the emails endpoint for the template. The template and the
|
|
185
|
+
recipient are left out of the response unless they are asked for, for example
|
|
186
|
+
fields=*,Template.Uid,Recipient.Uid.
|
|
187
|
+
* @summary Send an email template to a single person as a one-off email.
|
|
188
|
+
*/
|
|
189
|
+
export const templateSendTemplateEmail = (
|
|
190
|
+
templateUid: string | null,
|
|
191
|
+
templateSendTemplateEmailBody: TemplateSendTemplateEmailBody,
|
|
192
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
193
|
+
) => {
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
return customFetch<TemplateEmailInstance>(
|
|
197
|
+
{url: `/api/v1/templates/${templateUid}/send`, method: 'POST',
|
|
198
|
+
headers: {'Content-Type': 'application/json', },
|
|
199
|
+
data: templateSendTemplateEmailBody, signal
|
|
200
|
+
},
|
|
201
|
+
options);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
export const getTemplateSendTemplateEmailMutationOptions = <TError = void,
|
|
207
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof templateSendTemplateEmail>>, TError,{templateUid: string | null;data: TemplateSendTemplateEmailBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
208
|
+
): UseMutationOptions<Awaited<ReturnType<typeof templateSendTemplateEmail>>, TError,{templateUid: string | null;data: TemplateSendTemplateEmailBody}, TContext> => {
|
|
209
|
+
|
|
210
|
+
const mutationKey = ['templateSendTemplateEmail'];
|
|
211
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
212
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
213
|
+
options
|
|
214
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
215
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof templateSendTemplateEmail>>, {templateUid: string | null;data: TemplateSendTemplateEmailBody}> = (props) => {
|
|
221
|
+
const {templateUid,data} = props ?? {};
|
|
222
|
+
|
|
223
|
+
return templateSendTemplateEmail(templateUid,data,requestOptions)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
return { mutationFn, ...mutationOptions }}
|
|
230
|
+
|
|
231
|
+
export type TemplateSendTemplateEmailMutationResult = NonNullable<Awaited<ReturnType<typeof templateSendTemplateEmail>>>
|
|
232
|
+
export type TemplateSendTemplateEmailMutationBody = TemplateSendTemplateEmailBody
|
|
233
|
+
export type TemplateSendTemplateEmailMutationError = void
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @summary Send an email template to a single person as a one-off email.
|
|
237
|
+
*/
|
|
238
|
+
export const useTemplateSendTemplateEmail = <TError = void,
|
|
239
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof templateSendTemplateEmail>>, TError,{templateUid: string | null;data: TemplateSendTemplateEmailBody}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
240
|
+
): UseMutationResult<
|
|
241
|
+
Awaited<ReturnType<typeof templateSendTemplateEmail>>,
|
|
242
|
+
TError,
|
|
243
|
+
{templateUid: string | null;data: TemplateSendTemplateEmailBody},
|
|
244
|
+
TContext
|
|
245
|
+
> => {
|
|
246
|
+
|
|
247
|
+
const mutationOptions = getTemplateSendTemplateEmailMutationOptions(options);
|
|
248
|
+
|
|
249
|
+
return useMutation(mutationOptions);
|
|
250
|
+
}
|
|
251
|
+
|