mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 00:03:23 +00:00
BREAKING CHANGE: Remove custom transport support, use Payload's email config
- Removed custom transport configuration from plugin - Plugin now requires Payload email to be configured - Simplified setup by relying on Payload's email adapter - Updated README with new configuration requirements - Bump version to 0.2.0 (breaking change) Users must now configure email in their Payload config using an email adapter like @payloadcms/email-nodemailer instead of configuring transport in the plugin.
This commit is contained in:
32
README.md
32
README.md
@@ -28,26 +28,31 @@ npm install @xtr-dev/payload-mailing
|
||||
|
||||
## Quick Start
|
||||
|
||||
### 1. Add the plugin to your Payload config
|
||||
### 1. Configure email in your Payload config and add the plugin
|
||||
|
||||
```typescript
|
||||
import { buildConfig } from 'payload/config'
|
||||
import { mailingPlugin } from '@xtr-dev/payload-mailing'
|
||||
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
|
||||
|
||||
export default buildConfig({
|
||||
// ... your config
|
||||
email: nodemailerAdapter({
|
||||
defaultFromAddress: 'noreply@yoursite.com',
|
||||
defaultFromName: 'Your Site',
|
||||
transport: {
|
||||
host: 'smtp.gmail.com',
|
||||
port: 587,
|
||||
auth: {
|
||||
user: process.env.EMAIL_USER,
|
||||
pass: process.env.EMAIL_PASS,
|
||||
},
|
||||
},
|
||||
}),
|
||||
plugins: [
|
||||
mailingPlugin({
|
||||
defaultFrom: 'noreply@yoursite.com',
|
||||
transport: {
|
||||
host: 'smtp.gmail.com',
|
||||
port: 587,
|
||||
secure: false,
|
||||
auth: {
|
||||
user: process.env.EMAIL_USER,
|
||||
pass: process.env.EMAIL_PASS,
|
||||
},
|
||||
},
|
||||
defaultFromName: 'Your Site Name',
|
||||
retryAttempts: 3,
|
||||
retryDelay: 300000, // 5 minutes
|
||||
queue: 'email-queue', // optional
|
||||
@@ -119,13 +124,6 @@ mailingPlugin({
|
||||
return yourCustomEngine.render(template, variables)
|
||||
},
|
||||
|
||||
// Email transport
|
||||
transport: {
|
||||
host: 'smtp.gmail.com',
|
||||
port: 587,
|
||||
auth: { user: '...', pass: '...' }
|
||||
},
|
||||
|
||||
// Collection names (optional)
|
||||
collections: {
|
||||
templates: 'email-templates', // default
|
||||
|
||||
Reference in New Issue
Block a user