github payloadcms/payload v3.0.0-beta.12

latest releases: 3.0.0-beta.24, v3.0.0-beta.24, v2.15.0...
pre-release12 days ago

v3.0.0-beta.12

Features

Fixes

  • fix(db-postgres): validateExistingBlockIsIdentical for localized fields with the same name by @r1tsuu in #5840
  • fix: ensure body limit is respected by @JarrodMFlesch in #5807
  • fix(next): adds client-side field validations to login and forgot-password views by @PatrikKozak in #5871
  • fix(next): issue with password and confirm password fields not being type of password by @paulpopus in #5870
  • fix(next): check for matching passwords when creating the first user by @paulpopus in #5869
  • fix: postgres query hasMany in by @DanRibbens in #5884
  • fix(create-payload-app): uses baseUrl for payload config path in tsconfig by @JessChowdhury in #5888
  • fix(next): admin access control by @jacobsfletch in #5887
  • fix: accepts empty cell data by @kendelljoseph in #5876
  • fix(next): pass a corrent content-type header in getFile route by @r1tsuu in #5799
  • fix(next): do not require handlers, attempt to read filesystem or throw by @JarrodMFlesch in #5896
  • fix: adds type error validations for email and password in login operation by @PatrikKozak in #5899
  • fix(db-mongodb): ignore end session errors by @DanRibbens in #5905
  • fix(payload): Passes correct path to import modules on Windows started with file:// by @r1tsuu in #5919
  • fix: v3 update many with drafts by @DanRibbens in #5900
  • fix(db-postgres): v3 #5938 extra version suffix table names by @DanRibbens in #5940
  • fix(db-postgres): v3 nested groups in nested blocks by @DanRibbens in #5941
  • fix(plugin-cloud-storage)!: Pass filename to utility function getting file prefix by @SimonVreman in #5934
  • fix: add CORS headers to API Response by @jacobsfletch in #5906
  • fix(db-postgres): row table names were not being built properly by @PatrikKozak in #5960
  • fix: resave media using cloud storage plugin by @denolfe in #5959

⚠ BREAKING CHANGES

Providing an email configuration is now optional. If using nodemailer before, you will need to install a new package @payloadcms/email-nodemailer and use it in your config.

Email Configuration Before:

  • Providing any email configuration was completely optional and would configure nodemailer and ethereal.email with a test account by default.
// via payload.init
payload.init({
  email: {
    transport: someNodemailerTransport
    fromName: 'hello',
    fromAddress: 'hello@example.com',
  },
})
// or via email in payload.config.ts
export default buildConfig({
  email: {
    transport: someNodemailerTransport
    fromName: 'hello',
    fromAddress: 'hello@example.com',
  },
})

Email Configuration After:

  • All existing nodemailer functionality was abstracted into the @payloadcms/email-nodemailer package
  • No longer configured with ethereal.email by default.
  • Ability to pass email into the init function has been removed.
  • Warning will be given on startup if email not configured. Any sendEmail call will simply log the To address and subject.
// Using new nodemailer adapter package

import { nodemailerAdapter } from '@payloadcms/email-nodemailer'

export default buildConfig({
  email: nodemailerAdapter() // This will be the old ethereal.email functionality
})

// or pass in transport

export default buildConfig({
  email: nodemailerAdapter({
    defaultFromAddress: 'info@payloadcms.com',
    defaultFromName: 'Payload',
    transport: await nodemailer.createTransport({
      host: process.env.SMTP_HOST,
      port: 587,
      auth: {
        user: process.env.SMTP_USER,
        pass: process.env.SMTP_PASS,
      },
    })
  })
})
// Create custom email adapter

// myAdapter.ts
import type { EmailAdapter, SendMailOptions } from 'payload/types'

export const myAdapter: EmailAdapter = ({ payload }) => ({
  defaultFromAddress: defaults.defaultFromAddress,
  defaultFromName: defaults.defaultFromName,
  sendEmail: async (message) => {
    // Perform any logic here
    console.log(`To: '${message.to}', Subject: '${message.subject}'`)
    return Promise.resolve()
  },
})

// payload.config.ts
export default buildConfig({
  email: myAdapter()
})

Don't miss a new payload release

NewReleases is sending notifications on new releases.