From ac2522456fa64863214aad040dcdee437a7df735 Mon Sep 17 00:00:00 2001 From: Eddy Chen <89349085+ecxyzzy@users.noreply.github.com> Date: Mon, 19 Feb 2024 22:32:33 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20send=20endpoint=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/api/email/send/+server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/api/email/send/+server.ts b/src/routes/api/email/send/+server.ts index b2c47d8..7328c01 100644 --- a/src/routes/api/email/send/+server.ts +++ b/src/routes/api/email/send/+server.ts @@ -1,5 +1,5 @@ import { error, json } from "@sveltejs/kit"; -import { createMimeMessage, Mailbox } from "mimetext"; +import { createMimeMessage } from "mimetext"; import type { RequestHandler } from "./$types"; @@ -43,7 +43,7 @@ export const POST: RequestHandler = async (event) => { ({ attachments, htmlBody, plaintextBody, recipient, replyTo, subject }) => { const msg = createMimeMessage(); msg.setSender({ name: "ICS Student Council", addr: "icssc@uci.edu" }); - msg.setHeader("Reply-To", new Mailbox(replyTo)); + msg.setHeader("Reply-To", { addr: replyTo }); msg.setRecipient(recipient); msg.setSubject(subject); msg.addMessage({ contentType: "text/plain", data: plaintextBody }); @@ -65,5 +65,5 @@ export const POST: RequestHandler = async (event) => { await gmail.users.messages.send({ userId: "me", requestBody }); await sleep(1000); } - return json(results); + return json({}); };