@deliverart/sdk-js-电子邮件-通知-配置
交付艺术JavaScript SDK的电子邮件通知配置管理软件包.
安装
npm install @deliverart/sdk-js-email-notification-configuration @deliverart/sdk-js-core
导出类型
核心类型
EmailNotificationConfiguration- 带有所有细节的电子邮件通知配置EmailNotificationConfigurationListItem- 电子邮件通知配置列表项目EmailNotificationConfigurationConfig- 包含通知设置的配置对象WritableEmailNotificationConfiguration- 可写入电子邮件通知配置WritableCreateEmailNotificationConfiguration- 可创建电子邮件通知配置
模板密钥
可用的电子邮件模板密钥 :
delivery_started- 交货开始时通知delivery_taken_over- 接收交货时的通知order_created- 建立命令时的通知order_amended- 向最初的电子商务买方或经审查的枢纽联系人发出材料修正通知;适用源过滤器order_delivered- 发出命令的通知order_in_preparation- 命令准备时通知order_preparation_done- 完成订货准备后发出通知subscription_expiring- 提醒时间订阅即将到期subscription_low_credits- 提醒信贷的消费认购率低时subscription_pending_renewal- 当订阅需要续签时提醒subscription_payment_pending_verification- 需要中央管理人员核查的订阅费通知
排序来源
配置支持以下顺序源 :
application- 来自移动/网络应用程序的命令ecommerce- 电子商务平台的命令partner- 伙伴一体化的命令
IRI 类型
EmailNotificationConfigurationIri- 电子邮件通知配置IRI(/email_notification_configurations/:id(中文(简体) )
配置结构
每个电子邮件通知配置包含一个 config 带有模板特定设置的对象。 结构取决于模板键.
配置对象
顺序和交付模板的使用:
{
sourcesEnabled: string[]
}
订阅提醒模板的使用 :
{}
同样的空配置也用于订阅帐单核查通知.
字段 :
sourcesEnabled?: string[]- 应按订单和交付模板发送通知的订单来源序列
可用请求
创建电子邮件通知配置
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']
}
}));
订阅提醒示例 :
const config = await sdk.call(new CreateEmailNotificationConfiguration({
pointOfSale: '/point_of_sales/123',
templateKey: 'subscription_low_credits',
isActive: true,
config: {}
}));
订阅帐单核查示例 :
const config = await sdk.call(new CreateEmailNotificationConfiguration({
pointOfSale: '/point_of_sales/123',
templateKey: 'subscription_payment_pending_verification',
isActive: true,
config: {}
}));
输入参数:
pointOfSale: string(需要) - 销售点templateKey: string(需要) - 电子邮件模板密钥isActive: boolean(要求) - 启用/失效通知config: object(需要) - 有源的配置对象
获取电子邮件通知
import { GetEmailNotificationConfigurations } from '@deliverart/sdk-js-email-notification-configuration';
const configs = await sdk.call(new GetEmailNotificationConfigurations({
query: {
templateKey: 'order_created',
page: 1
}
}));
查询参数:
id?: string | string[]- 通过配置标识过滤templateKey?: string | string[]- 通过模板键过滤order[createdAt]?: string- 按创建日期排序order[updatedAt]?: string- 按更新日期排序page?: number- 页号createdAtFrom?: string- 通过创建日期过滤(从)createdAtTo?: string- 按创建日期过滤(至)updatedAtFrom?: string- 按更新日期过滤(从)updatedAtTo?: string- 按更新日期过滤(至)
获取电子邮件通知
import { GetEmailNotificationConfigurationDetails } from '@deliverart/sdk-js-email-notification-configuration';
const config = await sdk.call(new GetEmailNotificationConfigurationDetails('config-123'));
更新电子邮件通知
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']
}
}));
输入参数:
templateKey: string(需要) - 电子邮件模板密钥isActive: boolean(要求) - 启用/失效通知config: object(需要) - 配置对象- 命令/交付模板 :
sourcesEnabled: string[] - 订阅提醒模板: 空对象
{}
- 命令/交付模板 :
删除电子邮件通知
import { DeleteEmailNotificationConfiguration } from '@deliverart/sdk-js-email-notification-configuration';
await sdk.call(new DeleteEmailNotificationConfiguration('config-123'));
许可证
这个包是"交付艺术"JavaScript SDK的一部分.