feat: configure Payload SMTP email adapter
This commit is contained in:
@@ -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(),
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user