payload-plugin-newsletter 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +70 -0
- package/dist/components.cjs +1 -3
- package/dist/components.cjs.map +1 -1
- package/dist/components.js +1 -3
- package/dist/components.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## [0.12.2] - 2025-07-20
|
|
2
|
+
|
|
3
|
+
### Documentation
|
|
4
|
+
- Updated all documentation to reflect single-channel architecture
|
|
5
|
+
- Removed outdated references to 'name' field in broadcasts
|
|
6
|
+
- Added comprehensive broadcast sync documentation
|
|
7
|
+
- Updated email preview and React Email template documentation
|
|
8
|
+
- Revised multi-channel setup guide to indicate it's no longer supported
|
|
9
|
+
- Enhanced README with broadcast management and custom template examples
|
|
10
|
+
|
|
11
|
+
## [0.12.1] - 2025-07-20
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- Resolved ESLint errors in email preview components
|
|
15
|
+
- Removed unused imports and variables
|
|
16
|
+
- Fixed console.info statements in template loader
|
|
17
|
+
|
|
1
18
|
## [0.12.0] - 2025-07-20
|
|
2
19
|
|
|
3
20
|
### Added
|
package/README.md
CHANGED
|
@@ -21,6 +21,8 @@ A complete newsletter management plugin for [Payload CMS](https://github.com/pay
|
|
|
21
21
|
- 👁️ **Email Preview** - Real-time preview with desktop/mobile views (v0.9.0+)
|
|
22
22
|
- ✅ **Email Validation** - Built-in validation for email client compatibility (v0.9.0+)
|
|
23
23
|
- 📝 **Email-Safe Editor** - Rich text editor limited to email-compatible features (v0.9.0+)
|
|
24
|
+
- 📬 **Broadcast Management** - Create and send email campaigns with provider sync (v0.10.0+)
|
|
25
|
+
- 🎨 **React Email Templates** - Customizable email templates with React Email (v0.12.0+)
|
|
24
26
|
|
|
25
27
|
## Prerequisites
|
|
26
28
|
|
|
@@ -208,6 +210,69 @@ Built-in validation checks for:
|
|
|
208
210
|
- External resources that won't load
|
|
209
211
|
- JavaScript that will be stripped
|
|
210
212
|
|
|
213
|
+
## Broadcast Management (v0.10.0+)
|
|
214
|
+
|
|
215
|
+
Create and send email campaigns directly from Payload:
|
|
216
|
+
|
|
217
|
+
### Enable Broadcasts
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
newsletterPlugin({
|
|
221
|
+
features: {
|
|
222
|
+
newsletterManagement: {
|
|
223
|
+
enabled: true,
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
providers: {
|
|
227
|
+
default: 'broadcast',
|
|
228
|
+
broadcast: {
|
|
229
|
+
apiUrl: process.env.BROADCAST_API_URL,
|
|
230
|
+
token: process.env.BROADCAST_TOKEN,
|
|
231
|
+
fromAddress: 'newsletter@yoursite.com',
|
|
232
|
+
fromName: 'Your Newsletter',
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
This adds a `broadcasts` collection with:
|
|
239
|
+
- Rich text editor with email-safe formatting
|
|
240
|
+
- Image uploads with Media collection integration
|
|
241
|
+
- Custom email blocks (buttons, dividers)
|
|
242
|
+
- Inline email preview with React Email
|
|
243
|
+
- Automatic sync with your email provider
|
|
244
|
+
|
|
245
|
+
### Custom Email Templates (v0.12.0+)
|
|
246
|
+
|
|
247
|
+
Customize your email design with React Email templates:
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
// email-templates/broadcast-template.tsx
|
|
251
|
+
import { Html, Body, Container, Text, Link } from '@react-email/components'
|
|
252
|
+
|
|
253
|
+
export default function BroadcastTemplate({ subject, preheader, content }) {
|
|
254
|
+
return (
|
|
255
|
+
<Html>
|
|
256
|
+
<Body style={{ backgroundColor: '#ffffff', fontFamily: 'Arial, sans-serif' }}>
|
|
257
|
+
<Container style={{ maxWidth: '600px', margin: '0 auto' }}>
|
|
258
|
+
<Text style={{ fontSize: '16px', lineHeight: '1.6' }}>
|
|
259
|
+
<div dangerouslySetInnerHTML={{ __html: content }} />
|
|
260
|
+
</Text>
|
|
261
|
+
<hr style={{ margin: '40px 0', border: '1px solid #e5e7eb' }} />
|
|
262
|
+
<Text style={{ fontSize: '14px', color: '#6b7280', textAlign: 'center' }}>
|
|
263
|
+
<Link href="{{unsubscribe_url}}" style={{ color: '#6b7280' }}>
|
|
264
|
+
Unsubscribe
|
|
265
|
+
</Link>
|
|
266
|
+
</Text>
|
|
267
|
+
</Container>
|
|
268
|
+
</Body>
|
|
269
|
+
</Html>
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
The plugin automatically detects templates at `email-templates/broadcast-template.tsx`.
|
|
275
|
+
|
|
211
276
|
### Utilities
|
|
212
277
|
|
|
213
278
|
Convert Lexical content to email-safe HTML:
|
|
@@ -307,6 +372,11 @@ newsletterPlugin({
|
|
|
307
372
|
articlesCollection: 'posts', // Your articles/posts collection
|
|
308
373
|
},
|
|
309
374
|
|
|
375
|
+
// Broadcast management (v0.10.0+)
|
|
376
|
+
newsletterManagement: {
|
|
377
|
+
enabled: true, // Enables broadcasts collection
|
|
378
|
+
},
|
|
379
|
+
|
|
310
380
|
// UTM tracking
|
|
311
381
|
utmTracking: {
|
|
312
382
|
enabled: true,
|
package/dist/components.cjs
CHANGED
|
@@ -1824,10 +1824,8 @@ var TemplateLoader = class {
|
|
|
1824
1824
|
).catch(() => null);
|
|
1825
1825
|
if (module2) {
|
|
1826
1826
|
this.customTemplate = module2.default || module2.BroadcastTemplate;
|
|
1827
|
-
console.info("Loaded custom broadcast template");
|
|
1828
1827
|
}
|
|
1829
|
-
} catch
|
|
1830
|
-
console.info("Using default broadcast template");
|
|
1828
|
+
} catch {
|
|
1831
1829
|
}
|
|
1832
1830
|
}
|
|
1833
1831
|
// Reset for testing
|