Class: NotificationsService
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:72
Extends
BaseService
Constructors
Constructor
new NotificationsService(
client):NotificationsService
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:12
Parameters
client
Returns
NotificationsService
Inherited from
BaseService.constructor
Properties
client
protectedclient:TanqoryClient
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:10
Inherited from
BaseService.client
Methods
addStaffRecipient()
addStaffRecipient(
storeId,data):Promise<StaffNotificationRecipient>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:241
Add staff recipient
Parameters
storeId
string
data
Returns
Promise<StaffNotificationRecipient>
buildQuery()
protectedbuildQuery(options?):Record<string,any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:26
Build query parameters
Parameters
options?
Returns
Record<string, any>
Inherited from
BaseService.buildQuery
createWebhook()
createWebhook(
storeId,data):Promise<WebhookResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:302
Create webhook
Parameters
storeId
string
data
Returns
Promise<WebhookResponse>
deleteWebhook()
deleteWebhook(
storeId,webhookId):Promise<DeletedResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:322
Delete webhook
Parameters
storeId
string
webhookId
string
Returns
Promise<DeletedResponse>
generateEmailWithAi()
generateEmailWithAi(
storeId,templateId,data):Promise<GenerateAiEmailTemplateResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:348
Generate email template content using AI
Parameters
storeId
string
Store ID
templateId
string
Template ID (e.g., 'order_confirmation', 'shipping_update')
data
GenerateAiEmailTemplateInput
Email template generation parameters
Returns
Promise<GenerateAiEmailTemplateResponse>
Generated email template with subject and body
generateEmailWithAiStream()
generateEmailWithAiStream(
storeId,templateId,data):AsyncGenerator<string,void,unknown>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:378
Generate email template content using AI with streaming
Uses SDK streaming support for SSE responses. Yields content chunks as they arrive from the AI.
Parameters
storeId
string
Store ID
templateId
string
Template ID
data
GenerateAiEmailTemplateInput
Email template generation parameters
Returns
AsyncGenerator<string, void, unknown>
AsyncGenerator that yields content chunks
Example
for await (const chunk of tanqory.notifications.generateEmailWithAiStream(storeId, templateId, data)) {
setContent(prev => prev + chunk)
}
generateIdempotencyKey()
protectedgenerateIdempotencyKey(prefix):string
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:19
Generate idempotency key
Parameters
prefix
string
Returns
string
Inherited from
BaseService.generateIdempotencyKey
getCustomerCategories()
getCustomerCategories(
storeId):Promise<NotificationCategory[]>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:130
Get customer notification categories with templates
Parameters
storeId
string
Returns
Promise<NotificationCategory[]>
getEmailTemplate()
getEmailTemplate(
storeId,templateId):Promise<EmailTemplate>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:141
Get email template by ID
Parameters
storeId
string
templateId
string
Returns
Promise<EmailTemplate>
getExportMimeType()
protectedgetExportMimeType(format):string
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:45
Get MIME type for export format
Parameters
format
string
Returns
string
Inherited from
BaseService.getExportMimeType
getFulfillmentTemplate()
getFulfillmentTemplate(
storeId):Promise<EmailTemplate>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:267
Get fulfillment email template
Parameters
storeId
string
Returns
Promise<EmailTemplate>
getSettings()
getSettings(
storeId):Promise<NotificationSettings>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:109
Get store notification settings
Parameters
storeId
string
Returns
Promise<NotificationSettings>
getStaffNotifications()
getStaffNotifications(
storeId):Promise<StaffNotification[]>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:188
Get staff notification settings
Parameters
storeId
string
Returns
Promise<StaffNotification[]>
getStaffRecipients()
getStaffRecipients(
storeId,params?):Promise<ListResponse<StaffNotificationRecipient>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:229
Get staff notification recipients
Parameters
storeId
string
params?
limit?
number
page?
number
Returns
Promise<ListResponse<StaffNotificationRecipient>>
getWebhooks()
getWebhooks(
storeId,params?):Promise<ListResponse<WebhookResponse>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:290
Get store webhooks
Parameters
storeId
string
params?
limit?
number
page?
number
Returns
Promise<ListResponse<WebhookResponse>>
list()
list(
options?):Promise<ListResponse<NotificationResponse>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:80
List user notifications with pagination
Parameters
options?
ListOptions & Partial<{ isRead?: boolean; limit: number; offset?: number; page: number; type?: string; }>
Returns
Promise<ListResponse<NotificationResponse>>
markAllAsRead()
markAllAsRead():
Promise<MarkAllReadResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:98
Mark all notifications as read
Returns
Promise<MarkAllReadResponse>
markAsRead()
markAsRead(
id):Promise<NotificationResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:91
Mark notification as read
Parameters
id
string
Returns
Promise<NotificationResponse>
removeStaffRecipient()
removeStaffRecipient(
storeId,recipientId):Promise<DeletedResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:253
Remove staff recipient
Parameters
storeId
string
recipientId
string
Returns
Promise<DeletedResponse>
resetEmailTemplateToDefault()
resetEmailTemplateToDefault(
storeId,templateId):Promise<EmailTemplate>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:174
Reset email template to default content
Parameters
storeId
string
templateId
string
Returns
Promise<EmailTemplate>
sendTestEmail()
sendTestEmail(
storeId,templateId,Promise<void>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:163
Send test email
Parameters
storeId
string
templateId
string
email
string
Returns
Promise<void>
testWebhook()
testWebhook(
storeId,webhookId):Promise<void>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:329
Send a test webhook to verify the endpoint is reachable
Parameters
storeId
string
webhookId
string
Returns
Promise<void>
updateEmailTemplate()
updateEmailTemplate(
storeId,templateId,data):Promise<EmailTemplate>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:148
Update email template
Parameters
storeId
string
templateId
string
data
UpdateEmailTemplateInput
Returns
Promise<EmailTemplate>
updateFulfillmentTemplate()
updateFulfillmentTemplate(
storeId,data):Promise<EmailTemplate>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:274
Update fulfillment email template
Parameters
storeId
string
data
UpdateEmailTemplateInput
Returns
Promise<EmailTemplate>
updateSettings()
updateSettings(
storeId,data):Promise<NotificationSettings>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:116
Update store notification settings
Parameters
storeId
string
data
UpdateNotificationSettingsInput
Returns
Promise<NotificationSettings>
updateStaffNotification()
updateStaffNotification(
storeId,notificationId,enabled):Promise<StaffNotification>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:195
Update staff notification enabled state
Parameters
storeId
string
notificationId
string
enabled
boolean
Returns
Promise<StaffNotification>
updateStaffNotificationSchedule()
updateStaffNotificationSchedule(
storeId,notificationId,data):Promise<StaffNotification>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:210
Update staff notification schedule (for store_order_summary type)
Parameters
storeId
string
notificationId
string
data
UpdateStaffNotificationScheduleInput
Returns
Promise<StaffNotification>
updateWebhook()
updateWebhook(
storeId,webhookId,data):Promise<WebhookResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/notifications.ts:309
Update webhook
Parameters
storeId
string
webhookId
string
data
Returns
Promise<WebhookResponse>