Skip to content

Commit

Permalink
fix: 🐛 send endpoint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ecxyzzy committed Feb 20, 2024
1 parent d9d16c5 commit ac25224
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/api/email/send/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { error, json } from "@sveltejs/kit";
import { createMimeMessage, Mailbox } from "mimetext";
import { createMimeMessage } from "mimetext";

import type { RequestHandler } from "./$types";

Expand Down Expand Up @@ -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: "[email protected]" });
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 });
Expand All @@ -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({});
};

0 comments on commit ac25224

Please sign in to comment.