Skip to content

Commit

Permalink
chore: lessonTitle in email bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwisecodes committed Sep 2, 2024
1 parent 23b86b2 commit fa3235d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions apps/nextjs/src/components/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ export const DownloadButton = ({
<button
className="flex w-full items-center justify-start gap-15 hover:underline sm:hidden"
onClick={async () => {
const lessonTitle = lesson.title;
mutateAsync({
lessonTitle,
title,
link,
});
Expand Down
8 changes: 5 additions & 3 deletions packages/api/src/router/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ export const exportsRouter = router({
sendUserExportLink: protectedProcedure
.input(
z.object({
lessonTitle: z.string(),
title: z.string(),
link: z.string(),
}),
Expand All @@ -991,7 +992,7 @@ export const exportsRouter = router({
const user = await clerkClient.users.getUser(ctx.auth.userId);
const userEmail = user?.emailAddresses[0]?.emailAddress;
const userFirstName = user?.firstName;
const { title, link } = input;
const { title, link, lessonTitle } = input;
try {
if (!userEmail) {
return {
Expand All @@ -1006,14 +1007,15 @@ export const exportsRouter = router({
body: `
Hi ${userFirstName},
We made the lesson: ${title.toLowerCase()}
We made the lesson: ${lessonTitle}
You can use the following link to copy the lesson resources ${title.toLowerCase()} to your Google Drive: ${link.split("/edit")[0]}/copy}
We hope the lesson goes well for you and your class. If you have any feedback for us, please let us know. You can simply reply to this email.
Aila,
Oak National Academy`,
Oak National Academy
`,
});
return res;
} catch (error) {
Expand Down

0 comments on commit fa3235d

Please sign in to comment.