diff --git a/admin-spa/src/components/EmailBuilder/EmailBuilder.tsx b/admin-spa/src/components/EmailBuilder/EmailBuilder.tsx index 43cf17f..adf41f8 100644 --- a/admin-spa/src/components/EmailBuilder/EmailBuilder.tsx +++ b/admin-spa/src/components/EmailBuilder/EmailBuilder.tsx @@ -80,7 +80,7 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP throw new Error(`Unknown block type: ${type}`); } })(); - + onChange([...blocks, newBlock]); }; @@ -91,10 +91,10 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP const moveBlock = (id: string, direction: 'up' | 'down') => { const index = blocks.findIndex(b => b.id === id); if (index === -1) return; - + const newIndex = direction === 'up' ? index - 1 : index + 1; if (newIndex < 0 || newIndex >= blocks.length) return; - + const newBlocks = [...blocks]; [newBlocks[index], newBlocks[newIndex]] = [newBlocks[newIndex], newBlocks[index]]; onChange(newBlocks); @@ -102,7 +102,7 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP const openEditDialog = (block: EmailBlock) => { setEditingBlockId(block.id); - + if (block.type === 'card') { // Convert markdown to HTML for rich text editor const htmlContent = parseMarkdownBasics(block.content); @@ -121,16 +121,16 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP setEditingCustomMaxWidth(block.customMaxWidth); setEditingAlign(block.align); } - + setEditDialogOpen(true); }; const saveEdit = () => { if (!editingBlockId) return; - + const newBlocks = blocks.map(block => { if (block.id !== editingBlockId) return block; - + if (block.type === 'card') { // Convert HTML from rich text editor back to markdown for storage const markdownContent = htmlToMarkdown(editingContent); @@ -154,10 +154,10 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP align: editingAlign, }; } - + return block; }); - + onChange(newBlocks); setEditDialogOpen(false); setEditingBlockId(null); @@ -269,29 +269,23 @@ export function EmailBuilder({ blocks, onChange, variables = [] }: EmailBuilderP {/* Edit Dialog */} - { - // Check if WordPress media modal is currently open + // Only prevent closing if WordPress media modal is open const wpMediaOpen = document.querySelector('.media-modal'); - if (wpMediaOpen) { - // If WP media is open, ALWAYS prevent dialog from closing - // regardless of where the click happened e.preventDefault(); - return; } - - // If WP media is not open, prevent closing dialog for outside clicks - e.preventDefault(); + // Otherwise, allow the dialog to close normally via outside click }} onEscapeKeyDown={(e) => { - // Allow escape to close WP media modal + // Only prevent escape if WP media modal is open const wpMediaOpen = document.querySelector('.media-modal'); if (wpMediaOpen) { - return; + e.preventDefault(); } - e.preventDefault(); + // Otherwise, allow escape to close dialog }} > diff --git a/includes/Email/DefaultTemplates.php b/includes/Email/DefaultTemplates.php index 16b38ef..21d1c31 100644 --- a/includes/Email/DefaultTemplates.php +++ b/includes/Email/DefaultTemplates.php @@ -201,7 +201,7 @@ Your account is ready. Here\'s what you can do now: [button url="{set_password_url}" style="solid"]Set Your Password[/button] -This link will expire in 24 hours. Once set, you can log in anytime. +This link expires in 24 hours. If expired, use "Forgot Password?" on the login page. [/card] [button url="{shop_url}" style="outline"]Start Shopping[/button]