UNPKG

payload-plugin-newsletter

Version:

Complete newsletter management plugin for Payload CMS with subscriber management, magic link authentication, and email service integration

65 lines 1.41 kB
// src/fields/emailContent.ts import { BoldFeature, ItalicFeature, UnderlineFeature, StrikethroughFeature, LinkFeature, OrderedListFeature, UnorderedListFeature, HeadingFeature, ParagraphFeature, AlignFeature, BlockquoteFeature, lexicalEditor } from "@payloadcms/richtext-lexical"; var emailSafeFeatures = [ // Basic text formatting BoldFeature(), ItalicFeature(), UnderlineFeature(), StrikethroughFeature(), // Links with simple configuration LinkFeature({ fields: [{ name: "url", type: "text", required: true, admin: { description: "Enter the full URL (including https://)" } }] }), // Lists OrderedListFeature(), UnorderedListFeature(), // Headings - limited to h1, h2, h3 for email compatibility HeadingFeature({ enabledHeadingSizes: ["h1", "h2", "h3"] }), // Basic paragraph and alignment ParagraphFeature(), AlignFeature(), // Blockquotes BlockquoteFeature() ]; var createEmailContentField = (overrides) => { return { name: "content", type: "richText", required: true, editor: lexicalEditor({ features: emailSafeFeatures }), admin: { description: "Email content with limited formatting for compatibility", ...overrides?.admin }, ...overrides }; }; export { createEmailContentField, emailSafeFeatures }; //# sourceMappingURL=fields.js.map