@vrplatform/email 1.0.1 → 1.0.2-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/build/main/components/ActionEmailTemplate.d.ts +1 -1
  2. package/build/main/components/ActionEmailTemplate.js +18 -14
  3. package/build/main/components/ActionEmailTemplate.js.map +1 -1
  4. package/build/main/components/Button.d.ts +1 -1
  5. package/build/main/components/Button.js +7 -3
  6. package/build/main/components/Button.js.map +1 -1
  7. package/build/main/components/EmailContainer.d.ts +1 -1
  8. package/build/main/components/EmailContainer.js +26 -21
  9. package/build/main/components/EmailContainer.js.map +1 -1
  10. package/build/main/components/index.js +18 -2
  11. package/build/main/components/index.js.map +1 -1
  12. package/build/main/components/utils/index.js +17 -1
  13. package/build/main/components/utils/index.js.map +1 -1
  14. package/build/main/components/utils/parse-email-html.js +9 -5
  15. package/build/main/components/utils/parse-email-html.js.map +1 -1
  16. package/build/main/const.js +4 -1
  17. package/build/main/const.js.map +1 -1
  18. package/build/main/extensions.js +7 -4
  19. package/build/main/extensions.js.map +1 -1
  20. package/build/main/index.js +25 -6
  21. package/build/main/index.js.map +1 -1
  22. package/build/main/templates/InviteOwnerEmailTemplate.d.ts +1 -3
  23. package/build/main/templates/InviteOwnerEmailTemplate.js +12 -29
  24. package/build/main/templates/InviteOwnerEmailTemplate.js.map +1 -1
  25. package/build/main/templates/InvitePmEmailTemplate.d.ts +1 -3
  26. package/build/main/templates/InvitePmEmailTemplate.js +12 -34
  27. package/build/main/templates/InvitePmEmailTemplate.js.map +1 -1
  28. package/build/main/templates/OwnerStatementEmailTemplate.d.ts +1 -3
  29. package/build/main/templates/OwnerStatementEmailTemplate.js +15 -43
  30. package/build/main/templates/OwnerStatementEmailTemplate.js.map +1 -1
  31. package/build/main/templates/TenantDeletionEmailTemplate.d.ts +2 -4
  32. package/build/main/templates/TenantDeletionEmailTemplate.js +15 -19
  33. package/build/main/templates/TenantDeletionEmailTemplate.js.map +1 -1
  34. package/build/main/templates/TenantSuspensionEmailTemplate.d.ts +1 -3
  35. package/build/main/templates/TenantSuspensionEmailTemplate.js +13 -17
  36. package/build/main/templates/TenantSuspensionEmailTemplate.js.map +1 -1
  37. package/build/main/templates/index.d.ts +0 -3
  38. package/build/main/templates/index.js +21 -10
  39. package/build/main/templates/index.js.map +1 -1
  40. package/build/main/theme.d.ts +1 -1
  41. package/build/main/theme.js +7 -3
  42. package/build/main/theme.js.map +1 -1
  43. package/build/main/types.js +2 -1
  44. package/build/main/types.js.map +1 -1
  45. package/build/main/utils/index.js +17 -1
  46. package/build/main/utils/index.js.map +1 -1
  47. package/build/main/utils/send-email.d.ts +17 -10
  48. package/build/main/utils/send-email.js +41 -6
  49. package/build/main/utils/send-email.js.map +1 -1
  50. package/build/module/components/ActionEmailTemplate.d.ts +1 -1
  51. package/build/module/components/ActionEmailTemplate.js.map +1 -1
  52. package/build/module/components/Button.d.ts +1 -1
  53. package/build/module/components/Button.js.map +1 -1
  54. package/build/module/components/EmailContainer.d.ts +1 -1
  55. package/build/module/components/EmailContainer.js +2 -1
  56. package/build/module/components/EmailContainer.js.map +1 -1
  57. package/build/module/components/index.js.map +1 -1
  58. package/build/module/components/utils/index.js.map +1 -1
  59. package/build/module/components/utils/parse-email-html.js +4 -4
  60. package/build/module/components/utils/parse-email-html.js.map +1 -1
  61. package/build/module/const.js.map +1 -1
  62. package/build/module/extensions.js.map +1 -1
  63. package/build/module/index.js.map +1 -1
  64. package/build/module/templates/InviteOwnerEmailTemplate.d.ts +1 -3
  65. package/build/module/templates/InviteOwnerEmailTemplate.js +0 -22
  66. package/build/module/templates/InviteOwnerEmailTemplate.js.map +1 -1
  67. package/build/module/templates/InvitePmEmailTemplate.d.ts +1 -3
  68. package/build/module/templates/InvitePmEmailTemplate.js +0 -27
  69. package/build/module/templates/InvitePmEmailTemplate.js.map +1 -1
  70. package/build/module/templates/OwnerStatementEmailTemplate.d.ts +1 -3
  71. package/build/module/templates/OwnerStatementEmailTemplate.js +0 -33
  72. package/build/module/templates/OwnerStatementEmailTemplate.js.map +1 -1
  73. package/build/module/templates/TenantDeletionEmailTemplate.d.ts +2 -4
  74. package/build/module/templates/TenantDeletionEmailTemplate.js +0 -9
  75. package/build/module/templates/TenantDeletionEmailTemplate.js.map +1 -1
  76. package/build/module/templates/TenantSuspensionEmailTemplate.d.ts +1 -3
  77. package/build/module/templates/TenantSuspensionEmailTemplate.js +0 -8
  78. package/build/module/templates/TenantSuspensionEmailTemplate.js.map +1 -1
  79. package/build/module/templates/index.d.ts +0 -3
  80. package/build/module/templates/index.js +0 -5
  81. package/build/module/templates/index.js.map +1 -1
  82. package/build/module/theme.d.ts +1 -1
  83. package/build/module/theme.js.map +1 -1
  84. package/build/module/types.js.map +1 -1
  85. package/build/module/utils/index.js.map +1 -1
  86. package/build/module/utils/send-email.d.ts +17 -10
  87. package/build/module/utils/send-email.js +38 -6
  88. package/build/module/utils/send-email.js.map +1 -1
  89. package/package.json +31 -31
  90. package/src/components/EmailContainer.tsx +2 -1
  91. package/src/components/utils/parse-email-html.ts +4 -7
  92. package/src/templates/InviteOwnerEmailTemplate.tsx +0 -34
  93. package/src/templates/InvitePmEmailTemplate.tsx +0 -41
  94. package/src/templates/OwnerStatementEmailTemplate.tsx +0 -47
  95. package/src/templates/TenantDeletionEmailTemplate.tsx +0 -17
  96. package/src/templates/TenantSuspensionEmailTemplate.tsx +0 -16
  97. package/src/templates/index.ts +0 -7
  98. package/src/theme.ts +1 -1
  99. package/src/utils/send-email.ts +76 -27
  100. package/build/main/components/utils/parse-email-html.test.d.ts +0 -1
  101. package/build/main/components/utils/parse-email-html.test.js +0 -59
  102. package/build/main/components/utils/parse-email-html.test.js.map +0 -1
  103. package/build/main/templates/DailyDigestEmailTemplate.d.ts +0 -11
  104. package/build/main/templates/DailyDigestEmailTemplate.js +0 -97
  105. package/build/main/templates/DailyDigestEmailTemplate.js.map +0 -1
  106. package/build/main/templates/OwnerStatementSummaryEmailTemplate.d.ts +0 -9
  107. package/build/main/templates/OwnerStatementSummaryEmailTemplate.js +0 -46
  108. package/build/main/templates/OwnerStatementSummaryEmailTemplate.js.map +0 -1
  109. package/build/main/templates/OwnerTaxStatementEmailTemplate.d.ts +0 -10
  110. package/build/main/templates/OwnerTaxStatementEmailTemplate.js +0 -47
  111. package/build/main/templates/OwnerTaxStatementEmailTemplate.js.map +0 -1
  112. package/build/main/tsconfig.main.tsbuildinfo +0 -1
  113. package/build/module/components/utils/parse-email-html.test.d.ts +0 -1
  114. package/build/module/components/utils/parse-email-html.test.js +0 -59
  115. package/build/module/components/utils/parse-email-html.test.js.map +0 -1
  116. package/build/module/templates/DailyDigestEmailTemplate.d.ts +0 -11
  117. package/build/module/templates/DailyDigestEmailTemplate.js +0 -97
  118. package/build/module/templates/DailyDigestEmailTemplate.js.map +0 -1
  119. package/build/module/templates/OwnerStatementSummaryEmailTemplate.d.ts +0 -9
  120. package/build/module/templates/OwnerStatementSummaryEmailTemplate.js +0 -46
  121. package/build/module/templates/OwnerStatementSummaryEmailTemplate.js.map +0 -1
  122. package/build/module/templates/OwnerTaxStatementEmailTemplate.d.ts +0 -10
  123. package/build/module/templates/OwnerTaxStatementEmailTemplate.js +0 -47
  124. package/build/module/templates/OwnerTaxStatementEmailTemplate.js.map +0 -1
  125. package/build/module/tsconfig.esm.tsbuildinfo +0 -1
  126. package/src/components/utils/parse-email-html.test.ts +0 -65
  127. package/src/liveblocks.d.ts +0 -88
  128. package/src/templates/DailyDigestEmailTemplate.tsx +0 -186
  129. package/src/templates/OwnerStatementSummaryEmailTemplate.tsx +0 -78
  130. package/src/templates/OwnerTaxStatementEmailTemplate.tsx +0 -80
@@ -1,186 +0,0 @@
1
- import { Heading } from '@react-email/heading';
2
- import { Link } from '@react-email/link';
3
- import { Text } from '@react-email/text';
4
- import { EmailContainer } from '../components';
5
- import { Button } from '../components/Button';
6
- import type { EmailBaseProps } from '../types';
7
-
8
- type NotificationKey = keyof Liveblocks['ActivitiesData'];
9
-
10
- export type DailyDigestEmailTemplateProps = {
11
- mode: EmailBaseProps['mode'];
12
- unreadNotifications: Record<NotificationKey, { id: string; name: string }[]>;
13
- };
14
-
15
- const THEME_VRP = [
16
- // baseColor: #012F64
17
- '#E6F1FF',
18
- '#B8D9FE',
19
- '#8BC0FE',
20
- '#5DA8FD',
21
- '#308FFD',
22
- '#0377FC',
23
- '#025FCA',
24
- '#024797',
25
- '#012F65',
26
- '#011832',
27
- ] as const;
28
-
29
- const THEME_NEUTRAL = [
30
- '#fafafa',
31
- '#f5f5f5',
32
- '#e5e5e5',
33
- '#d4d4d4',
34
- '#a3a3a3',
35
- '#737373',
36
- '#525252',
37
- '#404040',
38
- '#262626',
39
- '#171717',
40
- // "#0a0a0a"
41
- ];
42
-
43
- const NOTIFICATION_ORDER: Record<
44
- NotificationKey,
45
- {
46
- title: string;
47
- text: string;
48
- order: number;
49
- }
50
- > = {
51
- $inviteOwnerAccepted: {
52
- title: 'Owners invitations',
53
- text: 'accepted invite',
54
- order: 1,
55
- },
56
- $inviteTeamMemberAccepted: {
57
- title: 'Team member invitations',
58
- text: 'accepted invite',
59
- order: 2,
60
- },
61
- $ownerStatementInReview: {
62
- title: 'Owner statements ready for review',
63
- text: 'is ready for review',
64
- order: 3,
65
- },
66
- $ownerStatementPublished: {
67
- title: 'Owner statements were published',
68
- text: 'was published to owner portal',
69
- order: 4,
70
- },
71
- $1099StatementPublished: {
72
- title: '1099 tax statements were published',
73
- text: 'was finalized and published',
74
- order: 5,
75
- },
76
- };
77
-
78
- export const DailyDigestEmailTemplate = ({
79
- mode,
80
-
81
- unreadNotifications,
82
- }: DailyDigestEmailTemplateProps) => {
83
- const total = Object.values(unreadNotifications).reduce(
84
- (acc, curr) => acc + curr.length,
85
- 0
86
- );
87
-
88
- const emailTitle = `You have ${total} unread notification${total > 1 ? 's' : ''}`;
89
-
90
- const link = 'https://portal.vrplatform.app/dashboard/inbox';
91
-
92
- return (
93
- <EmailContainer
94
- title={emailTitle}
95
- shortDescription={
96
- "Login to VRPlatform now to check your team's activity!"
97
- }
98
- tenant={{
99
- logo: undefined,
100
- }}
101
- mode={mode}
102
- >
103
- <Heading
104
- style={{
105
- fontSize: 26,
106
- fontWeight: 600,
107
- marginBottom: '50px',
108
- }}
109
- >
110
- {emailTitle}
111
- </Heading>
112
-
113
- {Object.entries(unreadNotifications)
114
- .sort(([aKey], [bKey]) => {
115
- const a = NOTIFICATION_ORDER[aKey as NotificationKey]?.order ?? 0;
116
- const b = NOTIFICATION_ORDER[bKey as NotificationKey]?.order ?? 0;
117
-
118
- return a - b;
119
- })
120
- .map(([key, notifications]) => {
121
- const data = NOTIFICATION_ORDER[key as NotificationKey];
122
-
123
- if (notifications.length === 0 || !data) return null;
124
-
125
- return (
126
- <div
127
- key={key}
128
- style={{
129
- marginBottom: '42px',
130
- }}
131
- >
132
- <Text
133
- style={{
134
- color: THEME_NEUTRAL[5],
135
- }}
136
- >
137
- {data.title}
138
- </Text>
139
- {notifications.map((not) => (
140
- <Text key={not.id} style={{ color: THEME_NEUTRAL[5] }}>
141
- <span
142
- style={{
143
- fontWeight: 800,
144
- color: '#000',
145
- }}
146
- >
147
- {not.name}
148
- </span>{' '}
149
- {data.text}
150
- </Text>
151
- ))}
152
- </div>
153
- );
154
- })}
155
-
156
- <Button
157
- href={link}
158
- mode={mode}
159
- data-testid="accept-invite-button"
160
- label={'Go to VRPlatform'}
161
- themeColors={THEME_VRP}
162
- style={{
163
- marginTop: '50px',
164
- marginBottom: '50px',
165
- }}
166
- />
167
-
168
- <Text>Best, VRPlatform</Text>
169
-
170
- <Text>
171
- If you have any trouble with the button, you can copy and paste the link
172
- below into your browser:{' '}
173
- <Link
174
- href={link}
175
- style={{
176
- display: 'inline',
177
- wordBreak: 'break-all',
178
- color: THEME_VRP[7],
179
- }}
180
- >
181
- {link}
182
- </Link>
183
- </Text>
184
- </EmailContainer>
185
- );
186
- };
@@ -1,78 +0,0 @@
1
- import {
2
- type ActionEmailData,
3
- ActionEmailTemplate,
4
- type ActionEmailTemplateProps,
5
- } from '../components';
6
- import {
7
- EMAIL_ACTION_LINK_COMPONENT,
8
- EMAIL_USER_NAME_COMPONENT,
9
- } from '../extensions';
10
-
11
- export const getDefaultOwnerStatementSummaryEmailData = (
12
- mode: 'tag' | 'text',
13
- args: {
14
- appName: string;
15
- ownerStatementHref: string;
16
- userName: string;
17
- }
18
- ): ActionEmailData => {
19
- const ownerStatementHref =
20
- mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.ownerStatementHref;
21
-
22
- const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;
23
-
24
- return {
25
- subject: 'Summary statement is ready',
26
- shortDescription: `An summary statement is ready for you. Log in to ${args.appName} to view it.`,
27
- header: 'Summary is ready to view',
28
- bodyOne: `<p>Hi ${userName},<p>A summary statement is ready for your review on ${args.appName}.</p><p>To access your statement, please click the button below:</p>`,
29
- buttonText: 'View statement',
30
- bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${ownerStatementHref}</p>`,
31
- href: args.ownerStatementHref,
32
- };
33
- };
34
-
35
- export const OwnerStatementSummaryEmailTemplate = (
36
- props: ActionEmailTemplateProps
37
- ) => {
38
- return <ActionEmailTemplate {...props} />;
39
- };
40
-
41
- const Preview = () => {
42
- const defaultName = 'John';
43
-
44
- return (
45
- <ActionEmailTemplate
46
- mode="send"
47
- tenant={{
48
- name: 'Pineapple Mountain',
49
- logo: 'https://imagedelivery.net/Ftdv9WftbW1DctaiLSVfFA/fbd8c31f-478f-4eb0-74ac-c8eeb47b5000/256x256',
50
- }}
51
- data={getDefaultOwnerStatementSummaryEmailData('text', {
52
- appName: 'VRPlatform',
53
- ownerStatementHref: 'https://example.com',
54
- userName: defaultName,
55
- })}
56
- user={{
57
- firstName: 'John',
58
- }}
59
- listing={undefined}
60
- month={undefined}
61
- themeColors={[
62
- // portal.brown
63
- '#9E9390',
64
- '#8D7C78',
65
- '#7C6964',
66
- '#6E5954',
67
- '#614B46',
68
- '#573F39',
69
- '#4E342E',
70
- '#3F2D29',
71
- '#332725',
72
- '#2A2220',
73
- ]}
74
- />
75
- );
76
- };
77
-
78
- export default Preview;
@@ -1,80 +0,0 @@
1
- import {
2
- EMAIL_ACTION_LINK_COMPONENT,
3
- EMAIL_USER_NAME_COMPONENT,
4
- } from '../extensions';
5
- import {
6
- type ActionEmailData,
7
- ActionEmailTemplate,
8
- type ActionEmailTemplateProps,
9
- } from '../components';
10
-
11
- export const getDefaultOwnerTaxStatementEmailData = (
12
- mode: 'tag' | 'text',
13
- args: {
14
- appName: string;
15
- href: string;
16
- firstName: string | undefined | null;
17
- year: number;
18
- }
19
- ): ActionEmailData => {
20
- const href = mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.href;
21
-
22
- const firstName =
23
- mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.firstName || 'there';
24
-
25
- return {
26
- subject: 'Your 1099 Tax Statement is ready',
27
- shortDescription: `Your 1099 Tax Statement is ready for you. Log in to ${args.appName} to view it.`,
28
- header: '1099 Tax Statement is ready',
29
- bodyOne: `<p>Hi ${firstName},<p>Your 1099 tax statement for ${args.year} is now available for you to review on ${args.appName}.</p><p>Click below to see your tax statement before we send it to the IRS.</p><p>To update your tax statement details, log into your ${args.appName} account and navigate to Settings>Statement Details.</p><p>To view your annual summary statement, navigate to the Summary page from within your ${args.appName} account.</p><p>Simply reply to this email if you have any questions.</p>`,
30
- buttonText: 'View tax statement',
31
- bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${href}</p>`,
32
- href: args.href,
33
- };
34
- };
35
-
36
- export const OwnerTaxStatementEmailTemplate = (
37
- props: ActionEmailTemplateProps
38
- ) => {
39
- return <ActionEmailTemplate {...props} />;
40
- };
41
-
42
- const Preview = () => {
43
- const defaultName = 'John';
44
-
45
- return (
46
- <ActionEmailTemplate
47
- mode="send"
48
- tenant={{
49
- name: 'Pineapple Mountain',
50
- logo: 'https://imagedelivery.net/Ftdv9WftbW1DctaiLSVfFA/fbd8c31f-478f-4eb0-74ac-c8eeb47b5000/256x256',
51
- }}
52
- data={getDefaultOwnerTaxStatementEmailData('text', {
53
- appName: 'VRPlatform',
54
- href: 'https://example.com',
55
- firstName: defaultName,
56
- year: new Date().getFullYear(),
57
- })}
58
- user={{
59
- firstName: 'John',
60
- }}
61
- listing={undefined}
62
- month={undefined}
63
- themeColors={[
64
- // portal.brown
65
- '#9E9390',
66
- '#8D7C78',
67
- '#7C6964',
68
- '#6E5954',
69
- '#614B46',
70
- '#573F39',
71
- '#4E342E',
72
- '#3F2D29',
73
- '#332725',
74
- '#2A2220',
75
- ]}
76
- />
77
- );
78
- };
79
-
80
- export default Preview;