feat: configure Payload SMTP email adapter

This commit is contained in:
2026-09-16 21:35:40 +02:00
parent e26da639ce
commit 906ea764ac
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import type { PayloadEmailAdapter } from "payload";
import { getMailFrom, getMailTransport } from "./transport";
/** Connects Payload's built-in auth emails to the same SMTP transport as ANOUMA's own emails. */
export const payloadEmailAdapter: PayloadEmailAdapter = () => ({
name: "anouma-smtp",
defaultFromAddress: process.env.SMTP_USER || "support@anouma.org",
defaultFromName: "ANOUMA",
sendEmail: async (message) => {
return getMailTransport().sendMail({
...message,
from: message.from || getMailFrom(),
});
},
});