message-template.interface.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { TemplateVariableTypeEnum, } from '../../types';
  2. import { TriggerContextTypeEnum } from '../notification-template';
  3. export const TemplateSystemVariables = ['subscriber', 'step', 'branding', 'tenant', 'preheader', 'actor'];
  4. export const SystemVariablesWithTypes = {
  5. subscriber: {
  6. firstName: 'string',
  7. lastName: 'string',
  8. email: 'string',
  9. phone: 'string',
  10. avatar: 'string',
  11. locale: 'string',
  12. subscriberId: 'string',
  13. },
  14. actor: {
  15. firstName: 'string',
  16. lastName: 'string',
  17. email: 'string',
  18. phone: 'string',
  19. avatar: 'string',
  20. locale: 'string',
  21. subscriberId: 'string',
  22. },
  23. step: {
  24. digest: 'boolean',
  25. events: 'array',
  26. total_count: 'number',
  27. },
  28. branding: {
  29. logo: 'string',
  30. color: 'string',
  31. },
  32. tenant: {
  33. name: 'string',
  34. data: 'object',
  35. },
  36. };
  37. export const TriggerReservedVariables = ['tenant', 'actor'];
  38. export const ReservedVariablesMap = {
  39. [TriggerContextTypeEnum.TENANT]: [{ name: 'identifier', type: TemplateVariableTypeEnum.STRING }],
  40. [TriggerContextTypeEnum.ACTOR]: [{ name: 'subscriberId', type: TemplateVariableTypeEnum.STRING }],
  41. };