@tracked/emails 0.1.4 → 0.2.0

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 (53) hide show
  1. package/dist/emails/client-onboarded.d.ts +35 -0
  2. package/dist/emails/client-onboarded.d.ts.map +1 -0
  3. package/dist/emails/client-onboarded.js +152 -0
  4. package/dist/emails/client-onboarded.js.map +1 -0
  5. package/dist/emails/index.d.ts +1 -0
  6. package/dist/emails/index.d.ts.map +1 -1
  7. package/dist/emails/index.js +1 -0
  8. package/dist/emails/index.js.map +1 -1
  9. package/dist/emails/monthly-report.d.ts.map +1 -1
  10. package/dist/emails/monthly-report.js +31 -47
  11. package/dist/emails/monthly-report.js.map +1 -1
  12. package/dist/index.d.ts +2 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +2 -2
  15. package/dist/index.js.map +1 -1
  16. package/package.json +20 -20
  17. package/src/components/content.tsx +351 -0
  18. package/src/components/index.ts +44 -0
  19. package/src/components/interactive.tsx +260 -0
  20. package/src/components/layout.tsx +217 -0
  21. package/src/components/tokens.ts +74 -0
  22. package/src/components/typography.tsx +148 -0
  23. package/src/emails/anniversary.tsx +133 -0
  24. package/src/emails/app-review-request.tsx +100 -0
  25. package/src/emails/bodyweight-goal-reached.tsx +202 -350
  26. package/src/emails/client-inactive-alert.tsx +130 -0
  27. package/src/emails/client-onboarded.tsx +272 -0
  28. package/src/emails/coach-invite.tsx +67 -250
  29. package/src/emails/coach-removed-client.tsx +36 -197
  30. package/src/emails/direct-message.tsx +69 -227
  31. package/src/emails/feature-discovery.tsx +82 -266
  32. package/src/emails/first-workout-assigned.tsx +52 -238
  33. package/src/emails/first-workout-completed.tsx +88 -294
  34. package/src/emails/inactive-reengagement.tsx +81 -0
  35. package/src/emails/index.tsx +1 -0
  36. package/src/emails/monthly-report.tsx +195 -525
  37. package/src/emails/new-follower.tsx +60 -238
  38. package/src/emails/nps-survey.tsx +149 -0
  39. package/src/emails/subscription-canceled.tsx +88 -294
  40. package/src/emails/support-email.tsx +33 -67
  41. package/src/emails/team-invite.tsx +47 -240
  42. package/src/emails/team-member-removed-email.tsx +23 -218
  43. package/src/emails/tracked-magic-link-activate.tsx +29 -237
  44. package/src/emails/tracked-magic-link.tsx +31 -251
  45. package/src/emails/week-one-checkin.tsx +108 -329
  46. package/src/emails/weekly-progress-digest.tsx +248 -0
  47. package/src/emails/welcome.tsx +58 -326
  48. package/src/index.ts +19 -2
  49. package/dist/emails/client-accepted-invitation.d.ts +0 -10
  50. package/dist/emails/client-accepted-invitation.d.ts.map +0 -1
  51. package/dist/emails/client-accepted-invitation.js +0 -99
  52. package/dist/emails/client-accepted-invitation.js.map +0 -1
  53. package/src/emails/client-accepted-invitation.tsx +0 -258
@@ -1,18 +1,17 @@
1
- import React from "react";
1
+ import * as React from "react";
2
+ import { Section, Img } from "@react-email/components";
2
3
  import {
3
- Body,
4
- Column,
5
- Container,
6
- Head,
7
- Hr,
8
- Html,
9
- Img,
10
- Link,
11
- Preview,
12
- Row,
13
- Section,
14
- Text,
15
- } from "@react-email/components";
4
+ EmailLayout,
5
+ EmailHeader,
6
+ EmailFooter,
7
+ Heading,
8
+ Paragraph,
9
+ FeatureBox,
10
+ SmallText,
11
+ PrimaryButton,
12
+ DiscordButton,
13
+ colors,
14
+ } from "../components";
16
15
 
17
16
  interface NewFollowerEmailProps {
18
17
  userName: string;
@@ -20,17 +19,15 @@ interface NewFollowerEmailProps {
20
19
  followerUsername?: string;
21
20
  followerAvatarUrl?: string;
22
21
  followerProfileUrl: string;
23
- websiteUrl: string;
22
+ websiteUrl?: string;
24
23
  }
25
24
 
26
- const baseUrl = "https://tracked.gg/android-chrome-192x192.png";
27
-
28
25
  export const NewFollowerEmail = ({
29
- userName,
30
- followerName,
31
- followerUsername,
32
- followerAvatarUrl,
33
- followerProfileUrl,
26
+ userName = "Alex",
27
+ followerName = "Jordan Smith",
28
+ followerUsername = "jordanfitness",
29
+ followerAvatarUrl = "https://cdn.trckd.ca/avatars/default.png",
30
+ followerProfileUrl = "tracked://app",
34
31
  websiteUrl = "https://tracked.gg",
35
32
  }: NewFollowerEmailProps) => {
36
33
  const displayName = followerUsername
@@ -38,223 +35,48 @@ export const NewFollowerEmail = ({
38
35
  : followerName;
39
36
 
40
37
  return (
41
- <Html>
42
- <Head>
43
- <meta name="color-scheme" content="light only" />
44
- <meta name="supported-color-schemes" content="light only" />
45
- </Head>
46
- <Preview>{followerName} started following you on Tracked</Preview>
47
- <Body style={main}>
48
- <Container style={container}>
49
- <Section style={box}>
50
- <Row style={{ marginBottom: "8px" }}>
51
- <Column style={{ width: "auto", verticalAlign: "middle" }}>
52
- <Img src={`${baseUrl}`} width="28" height="28" alt="Tracked" />
53
- </Column>
54
- <Column
55
- style={{
56
- width: "auto",
57
- verticalAlign: "middle",
58
- paddingLeft: "4px",
59
- }}
60
- >
61
- <Text
62
- style={{
63
- fontSize: "28px",
64
- fontWeight: "900",
65
- fontFamily:
66
- "Raleway, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
67
- color: "#020617",
68
- margin: "0",
69
- lineHeight: "32px",
70
- letterSpacing: "0.5px",
71
- }}
72
- >
73
- TRACKED
74
- </Text>
75
- </Column>
76
- </Row>
77
- <Hr style={hr} />
78
-
79
- <Text style={heading}>You Have a New Follower!</Text>
80
- <Text style={paragraph}>
81
- Hi {userName}, {displayName} started following you on Tracked.
82
- </Text>
83
-
84
- {followerAvatarUrl && (
85
- <Section
86
- style={{ textAlign: "center" as const, margin: "24px 0" }}
87
- >
88
- <Img
89
- src={followerAvatarUrl}
90
- width="80"
91
- height="80"
92
- alt={followerName}
93
- style={{
94
- borderRadius: "50%",
95
- border: "2px solid #4ade80",
96
- }}
97
- />
98
- </Section>
99
- )}
100
-
101
- <Section style={infoBox}>
102
- <Text style={infoText}>
103
- <strong>{displayName}</strong> is now following your fitness
104
- journey and will see your public workouts and achievements.
105
- </Text>
106
- </Section>
107
-
108
- <div
109
- style={{
110
- marginTop: "24px",
111
- marginBottom: "24px",
112
- textAlign: "left" as const,
113
- }}
114
- >
115
- <a
116
- href={followerProfileUrl}
117
- style={{
118
- backgroundColor: "#0f172a",
119
- borderRadius: "8px",
120
- fontSize: "16px",
121
- fontWeight: "bold",
122
- textDecoration: "none",
123
- padding: "12px 32px",
124
- display: "inline-block",
125
- }}
126
- >
127
- <span style={{ color: "#ffffff", textDecoration: "none" }}>
128
- View Profile
129
- </span>
130
- </a>
131
- </div>
132
-
133
- <Text style={{ ...paragraph }}>
134
- Check out their profile to see their workouts and consider
135
- following them back!
136
- </Text>
137
-
138
- <div
139
- style={{
140
- textAlign: "left" as const,
141
- margin: "24px 0",
142
- }}
143
- >
144
- <a
145
- href="https://www.discord.gg/trackedgg"
146
- style={{
147
- backgroundColor: "#5865F2",
148
- borderRadius: "8px",
149
- fontSize: "16px",
150
- fontWeight: "bold",
151
- textDecoration: "none",
152
- padding: "12px 32px",
153
- display: "inline-block",
154
- }}
155
- >
156
- <span style={{ color: "#ffffff", textDecoration: "none" }}>
157
- Join our Discord Community
158
- </span>
159
- </a>
160
- </div>
161
-
162
- <Hr style={hr} />
163
- <Text style={footer}>
164
- Copyright © Tracked Training Platform Inc. <br /> 9101 Horne
165
- Street, Vancouver, BC
166
- </Text>
167
-
168
- <Container>
169
- <Link
170
- href={`${websiteUrl}/terms`}
171
- style={{ ...footer, paddingRight: 10 }}
172
- >
173
- Terms
174
- </Link>
175
- <Link style={{ ...footer, paddingRight: 10 }}> | </Link>
176
- <Link
177
- href={`${websiteUrl}/privacy`}
178
- style={{ ...footer, paddingRight: 10 }}
179
- >
180
- Privacy
181
- </Link>
182
- <Link style={{ ...footer, paddingRight: 10 }}> | </Link>
183
- <Link
184
- href={`${websiteUrl}/support`}
185
- style={{ ...footer, paddingRight: 10 }}
186
- >
187
- Support
188
- </Link>
189
- </Container>
190
-
191
- <Text style={footer}>
192
- This is a service notification by the Tracked Training Platform.
193
- </Text>
194
- </Section>
195
- </Container>
196
- </Body>
197
- </Html>
38
+ <EmailLayout preview={`${followerName} started following you on Tracked`}>
39
+ <EmailHeader />
40
+
41
+ <Heading>You Have a New Follower!</Heading>
42
+ <Paragraph>
43
+ Hi {userName}, {displayName} started following you on Tracked.
44
+ </Paragraph>
45
+
46
+ {followerAvatarUrl && (
47
+ <Section style={{ textAlign: "center" as const, margin: "24px 0" }}>
48
+ <Img
49
+ src={followerAvatarUrl}
50
+ width="80"
51
+ height="80"
52
+ alt={followerName}
53
+ style={{
54
+ borderRadius: "50%",
55
+ border: `2px solid ${colors.accent}`,
56
+ }}
57
+ />
58
+ </Section>
59
+ )}
60
+
61
+ <FeatureBox>
62
+ <SmallText>
63
+ <strong>{displayName}</strong> is now following your fitness journey
64
+ and will see your public workouts and achievements.
65
+ </SmallText>
66
+ </FeatureBox>
67
+
68
+ <PrimaryButton href={followerProfileUrl}>View Profile</PrimaryButton>
69
+
70
+ <Paragraph>
71
+ Check out their profile to see their workouts and consider following
72
+ them back!
73
+ </Paragraph>
74
+
75
+ <DiscordButton />
76
+
77
+ <EmailFooter websiteUrl={websiteUrl} />
78
+ </EmailLayout>
198
79
  );
199
80
  };
200
81
 
201
- const main = {
202
- backgroundColor: "#020617", // slate-950
203
- fontFamily:
204
- '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif',
205
- };
206
-
207
- const container = {
208
- backgroundColor: "#020617", // slate-950
209
- margin: "0 auto",
210
- padding: "20px 0 48px",
211
- marginBottom: "64px",
212
- borderRadius: "8px",
213
- };
214
-
215
- const box = {
216
- padding: "0 24px",
217
- };
218
-
219
- const hr = {
220
- borderColor: "#4ade80", // green-400
221
- margin: "24px 0",
222
- borderWidth: "1px",
223
- };
224
-
225
- const paragraph = {
226
- color: "#ffffff", // white
227
- fontSize: "16px",
228
- lineHeight: "24px",
229
- textAlign: "left" as const,
230
- };
231
-
232
- const heading = {
233
- color: "#ffffff", // white
234
- fontSize: "24px",
235
- lineHeight: "32px",
236
- fontWeight: "bold",
237
- marginBottom: "16px",
238
- };
239
-
240
- const infoBox = {
241
- backgroundColor: "#1e293b",
242
- padding: "16px 24px",
243
- borderRadius: "8px",
244
- margin: "24px 0",
245
- };
246
-
247
- const infoText = {
248
- color: "#e2e8f0",
249
- fontSize: "14px",
250
- lineHeight: "24px",
251
- marginBottom: "4px",
252
- };
253
-
254
- const footer = {
255
- color: "#94a3b8", // slate-400 for subtle footer text
256
- fontSize: "12px",
257
- lineHeight: "16px",
258
- };
259
-
260
82
  export default NewFollowerEmail;
@@ -0,0 +1,149 @@
1
+ import * as React from "react";
2
+ import { Section, Text } from "@react-email/components";
3
+ import {
4
+ EmailLayout,
5
+ EmailHeader,
6
+ EmailFooter,
7
+ Heading,
8
+ Paragraph,
9
+ colors,
10
+ spacing,
11
+ borderRadius,
12
+ } from "../components";
13
+
14
+ interface NpsSurveyEmailProps {
15
+ userName: string;
16
+ surveyBaseUrl: string;
17
+ websiteUrl?: string;
18
+ unsubscribeUrl?: string;
19
+ }
20
+
21
+ const ScoreButton = ({
22
+ score,
23
+ baseUrl,
24
+ }: {
25
+ score: number;
26
+ baseUrl: string;
27
+ }) => {
28
+ const getColor = () => {
29
+ if (score <= 6) return colors.error;
30
+ if (score <= 8) return colors.warning;
31
+ return colors.success;
32
+ };
33
+
34
+ return (
35
+ <td style={{ padding: "0 2px" }}>
36
+ <a
37
+ href={`${baseUrl}?score=${score}`}
38
+ style={{
39
+ display: "inline-block",
40
+ width: "36px",
41
+ height: "36px",
42
+ lineHeight: "36px",
43
+ textAlign: "center" as const,
44
+ backgroundColor: colors.surface,
45
+ border: `1px solid ${colors.border}`,
46
+ borderRadius: borderRadius.sm,
47
+ color: colors.textPrimary,
48
+ fontSize: "14px",
49
+ fontWeight: "600",
50
+ textDecoration: "none",
51
+ }}
52
+ >
53
+ {score}
54
+ </a>
55
+ </td>
56
+ );
57
+ };
58
+
59
+ export const NpsSurveyEmail = ({
60
+ userName = "Alex",
61
+ surveyBaseUrl = "https://tracked.gg/survey/nps",
62
+ websiteUrl = "https://tracked.gg",
63
+ unsubscribeUrl = "https://tracked.gg/unsubscribe",
64
+ }: NpsSurveyEmailProps) => {
65
+ return (
66
+ <EmailLayout preview="Quick question: How likely are you to recommend Tracked?">
67
+ <EmailHeader />
68
+
69
+ <Heading>Quick Feedback</Heading>
70
+ <Paragraph>
71
+ Hi {userName}, we'd love your honest feedback. It only takes 10 seconds!
72
+ </Paragraph>
73
+
74
+ <Section
75
+ style={{
76
+ backgroundColor: colors.surface,
77
+ padding: spacing.lg,
78
+ borderRadius: borderRadius.md,
79
+ margin: `${spacing.lg} 0`,
80
+ border: `1px solid ${colors.border}`,
81
+ }}
82
+ >
83
+ <Text
84
+ style={{
85
+ color: colors.textPrimary,
86
+ fontSize: "16px",
87
+ fontWeight: "600",
88
+ textAlign: "center" as const,
89
+ margin: "0 0 16px 0",
90
+ }}
91
+ >
92
+ How likely are you to recommend Tracked to a friend?
93
+ </Text>
94
+
95
+ <table
96
+ cellPadding="0"
97
+ cellSpacing="0"
98
+ style={{ margin: "0 auto" }}
99
+ >
100
+ <tr>
101
+ {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((score) => (
102
+ <ScoreButton key={score} score={score} baseUrl={surveyBaseUrl} />
103
+ ))}
104
+ </tr>
105
+ </table>
106
+
107
+ <table
108
+ cellPadding="0"
109
+ cellSpacing="0"
110
+ style={{ width: "100%", marginTop: "12px" }}
111
+ >
112
+ <tr>
113
+ <td style={{ textAlign: "left" as const }}>
114
+ <Text
115
+ style={{
116
+ color: colors.textMuted,
117
+ fontSize: "12px",
118
+ margin: "0",
119
+ }}
120
+ >
121
+ Not likely
122
+ </Text>
123
+ </td>
124
+ <td style={{ textAlign: "right" as const }}>
125
+ <Text
126
+ style={{
127
+ color: colors.textMuted,
128
+ fontSize: "12px",
129
+ margin: "0",
130
+ }}
131
+ >
132
+ Very likely
133
+ </Text>
134
+ </td>
135
+ </tr>
136
+ </table>
137
+ </Section>
138
+
139
+ <Paragraph muted style={{ textAlign: "center" as const }}>
140
+ Just click a number above - that's it! Your feedback helps us build a
141
+ better app for everyone.
142
+ </Paragraph>
143
+
144
+ <EmailFooter websiteUrl={websiteUrl} marketing unsubscribeUrl={unsubscribeUrl} />
145
+ </EmailLayout>
146
+ );
147
+ };
148
+
149
+ export default NpsSurveyEmail;