payload-plugin-newsletter 0.14.3 → 0.15.1

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 CHANGED
@@ -1,3 +1,58 @@
1
+ ## [0.15.1] - 2025-07-27
2
+
3
+ ### Fixed
4
+ - **Email-Compatible Block Editor** - Resolved Next.js serialization errors with custom blocks
5
+ - Custom blocks are now processed server-side using Lexical's proven BlocksFeature pattern
6
+ - Prevents "Functions cannot be passed directly to Client Components" errors
7
+ - Maintains full email compatibility while enabling custom block functionality
8
+ - **Block Validation System** - Added validation utilities for email compatibility
9
+ - `validateEmailBlocks()` warns about potentially incompatible block types
10
+ - `createEmailSafeBlocks()` processes blocks for email-safe configurations
11
+ - Automatic detection of complex field types that may not render in email clients
12
+
13
+ ### Improved
14
+ - **Server-Side Block Processing** - Enhanced `createEmailLexicalEditor()` function
15
+ - Processes custom blocks into Lexical editor configuration before client serialization
16
+ - Clean separation between email-compatible and web-only content blocks
17
+ - Better performance through pre-configured editor instances
18
+ - **Enhanced Documentation** - Updated extension points guide with new approach
19
+ - Examples showing both legacy and new server-side processing methods
20
+ - Block validation utilities documentation
21
+ - Email compatibility best practices
22
+
23
+ ### Technical
24
+ - Added `createEmailLexicalEditor()` for server-side editor configuration
25
+ - Enhanced `createEmailContentField()` to accept pre-configured editors
26
+ - New utility exports: `validateEmailBlocks`, `createEmailSafeBlocks`
27
+ - Improved TypeScript support for custom block configurations
28
+
29
+ ## [0.15.0] - 2025-07-27
30
+
31
+ ### Added
32
+ - **Plugin Extensibility System** - New customization API for extending the Broadcasts collection
33
+ - `additionalFields` - Add custom fields to the Broadcasts collection
34
+ - `customBlocks` - Extend the email content editor with custom blocks
35
+ - `fieldOverrides` - Override default field configurations (e.g., content field customization)
36
+ - Full TypeScript support for all customization options
37
+ - **New Export Paths** for advanced usage
38
+ - `payload-plugin-newsletter/fields` - Access field factories and configurations
39
+ - `payload-plugin-newsletter/collections` - Access collection factories
40
+ - Export `createEmailSafeFeatures` function for custom rich text configurations
41
+ - **Comprehensive Documentation** - New extension points guide with examples and best practices
42
+ - Email-safe block creation guidelines
43
+ - TypeScript support documentation
44
+ - Migration and backward compatibility information
45
+
46
+ ### Improved
47
+ - Enhanced `createEmailContentField` to accept `additionalBlocks` parameter
48
+ - Maintained full backward compatibility with existing installations
49
+ - Added examples for e-commerce, SaaS, and content marketing use cases
50
+
51
+ ### Technical
52
+ - Updated build configuration to include new export paths
53
+ - Added proper TypeScript interfaces for customization options
54
+ - Enhanced field and collection factories for better extensibility
55
+
1
56
  ## [0.14.3] - 2025-07-23
2
57
 
3
58
  ### Fixed
package/README.md CHANGED
@@ -725,6 +725,53 @@ newsletterPlugin({
725
725
  })
726
726
  ```
727
727
 
728
+ ### Extending the Broadcasts Collection (v0.15.0+)
729
+
730
+ You can extend the Broadcasts collection with additional fields and custom email-compatible blocks:
731
+
732
+ ```typescript
733
+ import type { Block } from 'payload'
734
+
735
+ const customBlock: Block = {
736
+ slug: 'product-spotlight',
737
+ labels: { singular: 'Product Spotlight', plural: 'Product Spotlights' },
738
+ fields: [
739
+ { name: 'product', type: 'relationship', relationTo: 'products', required: true },
740
+ { name: 'description', type: 'textarea' }
741
+ ]
742
+ }
743
+
744
+ newsletterPlugin({
745
+ // ... existing config
746
+ customizations: {
747
+ broadcasts: {
748
+ additionalFields: [
749
+ {
750
+ name: 'slug',
751
+ type: 'text',
752
+ required: true,
753
+ admin: { position: 'sidebar' }
754
+ }
755
+ ],
756
+ customBlocks: [customBlock], // Processed server-side for email compatibility
757
+ fieldOverrides: {
758
+ content: (defaultField) => ({
759
+ ...defaultField,
760
+ admin: {
761
+ ...defaultField.admin,
762
+ description: 'Custom description'
763
+ }
764
+ })
765
+ }
766
+ }
767
+ }
768
+ })
769
+ ```
770
+
771
+ **Note**: Custom blocks are processed server-side to ensure email compatibility and prevent Next.js serialization errors.
772
+
773
+ For complete extensibility documentation, see the [Extension Points Guide](./docs/architecture/extension-points.md).
774
+
728
775
  ## Troubleshooting
729
776
 
730
777
  ### Common Issues