message-template.interface.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.ReservedVariablesMap = exports.TriggerReservedVariables = exports.SystemVariablesWithTypes = exports.TemplateSystemVariables = void 0;
  4. const types_1 = require("../../types");
  5. const notification_template_1 = require("../notification-template");
  6. exports.TemplateSystemVariables = ['subscriber', 'step', 'branding', 'tenant', 'preheader', 'actor'];
  7. exports.SystemVariablesWithTypes = {
  8. subscriber: {
  9. firstName: 'string',
  10. lastName: 'string',
  11. email: 'string',
  12. phone: 'string',
  13. avatar: 'string',
  14. locale: 'string',
  15. subscriberId: 'string',
  16. },
  17. actor: {
  18. firstName: 'string',
  19. lastName: 'string',
  20. email: 'string',
  21. phone: 'string',
  22. avatar: 'string',
  23. locale: 'string',
  24. subscriberId: 'string',
  25. },
  26. step: {
  27. digest: 'boolean',
  28. events: 'array',
  29. total_count: 'number',
  30. },
  31. branding: {
  32. logo: 'string',
  33. color: 'string',
  34. },
  35. tenant: {
  36. name: 'string',
  37. data: 'object',
  38. },
  39. };
  40. exports.TriggerReservedVariables = ['tenant', 'actor'];
  41. exports.ReservedVariablesMap = {
  42. [notification_template_1.TriggerContextTypeEnum.TENANT]: [{ name: 'identifier', type: types_1.TemplateVariableTypeEnum.STRING }],
  43. [notification_template_1.TriggerContextTypeEnum.ACTOR]: [{ name: 'subscriberId', type: types_1.TemplateVariableTypeEnum.STRING }],
  44. };