@deliverart/sdk-js-email-notification-configuration
v2.9.3
Published
Deliverart JavaScript SDK for Email Notification Configuration
Downloads
1,403
Readme
@deliverart/sdk-js-email-notification-configuration
Email notification configuration management package for the DeliverArt JavaScript SDK.
Installation
npm install @deliverart/sdk-js-email-notification-configuration @deliverart/sdk-js-coreExported Types
Core Types
EmailNotificationConfiguration- Email notification configuration with all detailsEmailNotificationConfigurationListItem- Email notification configuration list itemEmailNotificationConfigurationConfig- Configuration object containing notification settingsWritableEmailNotificationConfiguration- Writable email notification configurationWritableCreateEmailNotificationConfiguration- Writable create email notification configuration
Template Keys
Available email template keys:
delivery_started- Notification when delivery startsdelivery_taken_over- Notification when delivery is taken overorder_created- Notification when order is createdorder_delivered- Notification when order is deliveredorder_in_preparation- Notification when order enters preparationorder_preparation_done- Notification when order preparation is complete
Order Sources
Configuration supports the following order sources:
application- Orders from mobile/web applicationecommerce- Orders from ecommerce platformpartner- Orders from partner integrations
IRI Types
EmailNotificationConfigurationIri- Email notification configuration IRI (/email_notification_configurations/:id)
Configuration Structure
Each email notification configuration contains a config object with template-specific settings. The configuration structure is designed to be extensible for future template-specific fields.
Config Object
{
sourcesEnabled: string[] // Array of enabled order sources
}Fields:
sourcesEnabled?: string[]- Array of order sources for which the notification should be sent
Available Requests
CreateEmailNotificationConfiguration
import { CreateEmailNotificationConfiguration } from '@deliverart/sdk-js-email-notification-configuration';
const config = await sdk.call(new CreateEmailNotificationConfiguration({
pointOfSale: '/point_of_sales/123',
templateKey: 'order_preparation_done',
isActive: true,
config: {
sourcesEnabled: ['application']
}
}));Input Parameters:
pointOfSale: string(required) - Point of sale IRItemplateKey: string(required) - Email template keyisActive: boolean(required) - Enable/disable notificationconfig: object(required) - Configuration object with sourcesEnabled
GetEmailNotificationConfigurations
import { GetEmailNotificationConfigurations } from '@deliverart/sdk-js-email-notification-configuration';
const configs = await sdk.call(new GetEmailNotificationConfigurations({
query: {
templateKey: 'order_created',
page: 1
}
}));Query Parameters:
id?: string | string[]- Filter by configuration IDtemplateKey?: string | string[]- Filter by template keyorder[createdAt]?: string- Sort by creation dateorder[updatedAt]?: string- Sort by update datepage?: number- Page numbercreatedAtFrom?: string- Filter by creation date (from)createdAtTo?: string- Filter by creation date (to)updatedAtFrom?: string- Filter by update date (from)updatedAtTo?: string- Filter by update date (to)
GetEmailNotificationConfigurationDetails
import { GetEmailNotificationConfigurationDetails } from '@deliverart/sdk-js-email-notification-configuration';
const config = await sdk.call(new GetEmailNotificationConfigurationDetails('config-123'));UpdateEmailNotificationConfiguration
import { UpdateEmailNotificationConfiguration } from '@deliverart/sdk-js-email-notification-configuration';
const updated = await sdk.call(new UpdateEmailNotificationConfiguration('config-123', {
templateKey: 'order_preparation_done',
isActive: false,
config: {
sourcesEnabled: ['application', 'ecommerce']
}
}));Input Parameters:
templateKey: string(required) - Email template keyisActive: boolean(required) - Enable/disable notificationconfig: object(required) - Configuration objectsourcesEnabled: string[]- Array of enabled order sources
DeleteEmailNotificationConfiguration
import { DeleteEmailNotificationConfiguration } from '@deliverart/sdk-js-email-notification-configuration';
await sdk.call(new DeleteEmailNotificationConfiguration('config-123'));License
This package is part of the DeliverArt JavaScript SDK.
