Skip to content

Form builder plugin uses default mail configuration #3

@mmikhan

Description

@mmikhan

I like how you are instantiating the mail feature through the global settings manually instead of using the plugin itself.

export const sendEmail = async ({ to, subject, html }: EmailPayload): Promise<EmailResponse> => {
const { transporter, fromEmail } = await createEmailTransporter();
try {
const { messageId } = await transporter.sendMail({
from: fromEmail,
to,
subject,
html,
});
return { success: true, messageId };
} catch (error) {
const errorMessage = error instanceof Error ? error.message : "Unknown email error";
throw new Error(`Failed to send email: ${errorMessage}`);
}
};

However, it doesn't work with the form builder plugin. Form builder plugin still uses the mail configuration defined in the Payload config. There's no email: {} configuration defined in the Payload config at this point thus, form builder email won't work.

How are we going to override the form builder plugin's mail configuration to ensure it uses the customer mail configuration instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions