Template Variables Tree
模板变量系统设计定稿 - 2024-02-04
string 字符串
number 数字
date 日期/时间
boolean 布尔值
array 数组
computed 计算字段
根变量: appointment — Service 类型模板围绕一个具体的预约事件展开,用于发送预约确认、提醒、完成通知等。
| 变量名 |
完整路径 |
类型 |
说明 |
| id | appointment.id | string | 预约ID |
| date | appointment.date | date | 预约日期 |
| time | appointment.time | time | 预约时间 |
| datetime | appointment.datetime | datetime | 完整时间戳 |
| duration | appointment.duration | number | 服务时长 (分钟) |
| endTime | appointment.endTime | time | 结束时间 |
| status | appointment.status | string | 状态 (pending/confirmed/in_progress/completed/cancelled/no_show) |
| isFirstVisit | appointment.isFirstVisit | boolean | 是否首次到店 |
| specialRequests | appointment.specialRequests | string | 特殊要求 |
| notes | appointment.notes | string | 备注 |
| 变量名 | 完整路径 | 类型 | 说明 |
| quotedPrice | appointment.quotedPrice | number | 报价 |
| finalPrice | appointment.finalPrice | number | 最终价格 |
| totalAmount | appointment.totalAmount | number | 总金额 |
| paymentStatus | appointment.paymentStatus | string | 支付状态 (pending/paid/partial/refunded) |
| paymentMethod | appointment.paymentMethod | string | 支付方式 |
| 变量名 | 完整路径 | 类型 | 说明 |
| firstName | appointment.guest.firstName | string | 名 |
| lastName | appointment.guest.lastName | string | 姓 |
| fullName | appointment.guest.fullName | computed | 全名 (firstName + lastName) |
| email | appointment.guest.email | string | 邮箱 |
| phone | appointment.guest.phone | string | 电话 |
| dateOfBirth | appointment.guest.dateOfBirth | date | 生日 |
| gender | appointment.guest.gender | string | 性别 |
| loyaltyPoints | appointment.guest.loyaltyPoints | number | 当前积分 |
| totalVisits | appointment.guest.totalVisits | number | 总访问次数 |
| totalSpent | appointment.guest.totalSpent | number | 累计消费 |
| membershipTier | appointment.guest.membershipTier | computed | 会员等级名称 |
| 变量名 | 完整路径 | 类型 | 说明 |
| firstName | appointment.employee.firstName | string | 名 |
| lastName | appointment.employee.lastName | string | 姓 |
| fullName | appointment.employee.fullName | computed | 全名 |
| email | appointment.employee.email | string | 邮箱 |
| phone | appointment.employee.phone | string | 电话 |
| jobTitle | appointment.employee.jobTitle | string | 职位 |
| 变量名 | 完整路径 | 类型 | 说明 |
| name | appointment.service.name | string | 服务名称 |
| description | appointment.service.description | string | 服务描述 |
| category | appointment.service.category | string | 服务分类 |
| price | appointment.service.price | number | 服务价格 |
| duration | appointment.service.duration | number | 服务时长 |
| imageUrl | appointment.service.imageUrl | string | 服务图片 |
| 变量名 | 完整路径 | 类型 | 说明 |
| name | appointment.subServices[].name | string | 服务名称 |
| price | appointment.subServices[].price | number | 价格 |
| duration | appointment.subServices[].duration | number | 时长 |
| 变量名 | 完整路径 | 类型 | 说明 |
| name | appointment.store.name | string | 店铺名称 |
| phone | appointment.store.phone | string | 店铺电话 |
| email | appointment.store.email | string | 店铺邮箱 |
| website | appointment.store.website | string | 店铺网站 |
| logo | appointment.store.logo | string | 店铺Logo |
| address | appointment.store.address | computed | 完整地址 |
| street | appointment.store.street | string | 街道 |
| city | appointment.store.city | string | 城市 |
| state | appointment.store.state | string | 州 |
| zipCode | appointment.store.zipCode | string | 邮编 |
| country | appointment.store.country | string | 国家 |
| timezone | appointment.store.timezone | string | 时区 |
| openingHours | appointment.store.openingHours | string | 营业时间 |
根变量: guest — Marketing 类型模板围绕客人展开,用于发送营销活动、生日祝福、召回通知等。
| 变量名 | 完整路径 | 类型 | 说明 |
| firstName | guest.firstName | string | 名 |
| lastName | guest.lastName | string | 姓 |
| fullName | guest.fullName | computed | 全名 |
| email | guest.email | string | 邮箱 |
| phone | guest.phone | string | 电话 |
| dateOfBirth | guest.dateOfBirth | date | 生日 |
| gender | guest.gender | string | 性别 |
| registeredAt | guest.registeredAt | datetime | 注册时间 |
| 变量名 | 完整路径 | 类型 | 说明 |
| loyaltyPoints | guest.loyaltyPoints | number | 当前积分 |
| totalVisits | guest.totalVisits | number | 总访问次数 |
| totalSpent | guest.totalSpent | number | 累计消费 |
| averageSpend | guest.averageSpend | computed | 平均消费 (totalSpent / totalVisits) |
| lastVisitDate | guest.lastVisitDate | date | 上次到店日期 |
| daysSinceVisit | guest.daysSinceVisit | computed | 距上次到店天数 |
| 变量名 | 完整路径 | 类型 | 说明 |
| membershipTier | guest.membershipTier | computed | 会员等级名称 (bronze/silver/gold/platinum) |
| membershipColor | guest.membershipColor | computed | 等级颜色 |
| membershipDiscount | guest.membershipDiscount | computed | 会员折扣百分比 |
| membershipValidUntil | guest.membershipValidUntil | computed | 会员到期日期 |
| isVip | guest.isVip | computed | 是否VIP (tier >= gold) |
| 变量名 | 完整路径 | 类型 | 说明 |
| favoriteService | guest.favoriteService | computed | 最常预约的服务 |
| favoriteEmployee | guest.favoriteEmployee | computed | 最常指定的技师 |
| preferredStore | guest.preferredStore | computed | 最常去的店铺 |
| preferredTimeSlot | guest.preferredTimeSlot | computed | 偏好时间段 (morning/afternoon/evening) |
| 变量名 | 完整路径 | 类型 | 说明 |
| tags | guest.tags | array | 标签列表 (字符串数组) |
| 变量名 | 完整路径 | 类型 | 说明 |
| street | guest.address.street | string | 街道 |
| city | guest.address.city | string | 城市 |
| state | guest.address.state | string | 州 |
| zipCode | guest.address.zipCode | string | 邮编 |
| country | guest.address.country | string | 国家 |
| 变量名 | 完整路径 | 类型 | 说明 |
| date | guest.lastAppointment.date | date | 预约日期 |
| time | guest.lastAppointment.time | time | 预约时间 |
| serviceName | guest.lastAppointment.serviceName | string | 服务名称 |
| employeeName | guest.lastAppointment.employeeName | string | 技师名称 |
| storeName | guest.lastAppointment.storeName | string | 店铺名称 |
| totalAmount | guest.lastAppointment.totalAmount | number | 金额 |
| status | guest.lastAppointment.status | string | 状态 |
| 变量名 | 完整路径 | 类型 | 说明 |
| date | guest.nextAppointment.date | date | 预约日期 |
| time | guest.nextAppointment.time | time | 预约时间 |
| serviceName | guest.nextAppointment.serviceName | string | 服务名称 |
| employeeName | guest.nextAppointment.employeeName | string | 技师名称 |
| storeName | guest.nextAppointment.storeName | string | 店铺名称 |
通用系统变量 — 这些变量在 Service 和 Marketing 两种类型的模板中都可以使用。
| 变量名 | 完整路径 | 类型 | 说明 |
| currentDate | system.currentDate | date | 当前日期 (YYYY-MM-DD) |
| currentTime | system.currentTime | time | 当前时间 (HH:MM) |
| currentYear | system.currentYear | number | 当前年份 |
| currentMonth | system.currentMonth | number | 当前月份 |
| 变量名 | 完整路径 | 类型 | 说明 |
| bookingLink | system.bookingLink | string | 预约链接 |
| unsubscribeLink | system.unsubscribeLink | string | 退订链接 |
| feedbackLink | system.feedbackLink | string | 反馈链接 |
| accountLink | system.accountLink | string | 账户链接 |
| rewardsLink | system.rewardsLink | string | 奖励/积分链接 |
| 变量名 | 完整路径 | 类型 | 说明 |
| name | system.brand.name | string | 品牌名称 |
| logo | system.brand.logo | string | 品牌Logo |
| website | system.brand.website | string | 品牌官网 |
| supportEmail | system.brand.supportEmail | string | 客服邮箱 |