Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Nodemailer in Payload Beta

default discord avatar
0815saucelast year
11

How can I best set up Nodemailer in Payload beta so that 1. I receive the message from the contact form and 2. the user receives an e-mail that his message has arrived.



Nodemailer for Payload cannot be installed.



Install error:



pnpm add @payloadcms/email-nodemailer` nodemailer
 ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER  @payloadcms/email-nodemailer nodemailer isn't supported by any available resolver.

This error happened while installing a direct dependency of F:\SGNetz-Projekte\ramm-news
Progress: resolved 1, reused 0, downloaded 0, added 0


Anyone know, how I can config nodemail in v3? Its finaly installed But know I Need some help

  • default discord avatar
    richard.hogbenlast year

    I use this in buildConfig



    email: nodemailerAdapter({ defaultFromAddress: 'test@test.com', defaultFromName: 'Test', transportOptions: { host: process.env.SMTP_HOST, port: 587, auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS, }, }, }),
  • default discord avatar
    0815saucelast year

    Thx, but know, i got this ..



    204 | })
      205 | function nodemailerAdapter(arg0: { defaultFromAddress: string; defaultFromName: string; transportOptions: { host: string; port: number; auth: { user: string; pass: string } } }): import("payload").PayloadEmailAdapter | Promise<import("payload").PayloadEmailAdapter> {
    > 206 |   throw new Error('Function not implemented.')
          |         ^
      207 | }
      208 |
      209 |
     GET /admin 500 in 3959ms
  • default discord avatar
    richard.hogbenlast year

    are you importing it in the config



    import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
  • default discord avatar
    0815saucelast year

    okay ... i forgot it .. its now working

  • default discord avatar
    richard.hogbenlast year
    :niceone:

    you can mark this as /solve

  • default discord avatar
    0815saucelast year

    I Have only one questen, is there a easy way to make a email template? In Payload i can do only basic stuf

  • default discord avatar
    0815saucelast year

    I Know the Form Builder, i can setup text and thats it. What i Want is a custom mail template, with logo, colors and some other changes 😦

  • default discord avatar
    0815saucelast year

    add the react mail template to the buildconfig in payload?

  • default discord avatar
    minsomailast year


    Here is an example for custom:


    verify and forgotPassword email template



    you have to return the custom HTML template. in this case, build your email template in react email and paste it somewhere

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.