Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
✨ Use custom branding on scheduled poll email (#2324)
Luke Vella034fb0c76a02
diff --git a/apps/web/src/trpc/routers/polls.ts b/apps/web/src/trpc/routers/polls.tsindex 533860169..bbc115e7e 100644--- a/apps/web/src/trpc/routers/polls.ts+++ b/apps/web/src/trpc/routers/polls.ts@@ -15,6 +15,7 @@ import { getActiveSpaceForUser } from "@/features/space/data";import { dayjs } from "@/lib/dayjs";import { getEmailClient } from "@/utils/emails";import { createIcsEvent } from "@/utils/ics";+import { resolveStorageUrl } from "@/utils/storage";import {createRateLimitMiddleware,possiblyPublicProcedure,@@ -698,6 +699,13 @@ export const polls = router({location: true,description: true,spaceId: true,+ space: {+ select: {+ showBranding: true,+ primaryColor: true,+ image: true,+ },+ },user: {select: {name: true,@@ -917,6 +925,13 @@ export const polls = router({const hostEmail = poll.user.email;const hostName = poll.user.name;+ const space = poll.space;+ const participantBrandingOptions = space?.showBranding+ ? {+ primaryColor: space.primaryColor ?? undefined,+ logoUrl: space.image ? resolveStorageUrl(space.image) : undefined,+ }+ : {};const emailClient = await getEmailClient({locale: poll.user.locale ?? undefined,});@@ -958,6 +973,7 @@ export const polls = router({});const emailClient = await getEmailClient({locale: p.locale ?? undefined,+ ...participantBrandingOptions,});after(() =>emailClient.sendTemplate("FinalizeParticipantEmail", {