♻️ Improve email abstraction (#861)

This commit is contained in:
Luke Vella 2023-09-15 14:21:35 +01:00 committed by GitHub
parent 9e453da1dd
commit 93cc5b9b4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 749 additions and 152 deletions

View file

@ -1,9 +1,9 @@
import { prisma } from "@rallly/database";
import { sendEmail } from "@rallly/emails";
import { absoluteUrl } from "@rallly/utils";
import { z } from "zod";
import { createToken } from "../../../session";
import { emailClient } from "../../../utils/email-client";
import { publicProcedure, router } from "../../trpc";
import { DisableNotificationsPayload } from "../../types";
@ -82,7 +82,7 @@ export const comments = router({
{ ttl: 0 },
);
emailsToSend.push(
sendEmail("NewCommentEmail", {
emailClient.sendTemplate("NewCommentEmail", {
to: email,
subject: `${authorName} has commented on ${poll.title}`,
props: {