Fix button roundtrip in editor, alignment persistence, and test email rendering

This commit is contained in:
Dwindi Ramadhana
2026-01-17 13:10:50 +07:00
parent 0e9ace902d
commit 6d2136d3b5
61 changed files with 8287 additions and 866 deletions

View File

@@ -373,13 +373,15 @@ class EmailRenderer {
$content = MarkdownParser::parse($content);
// Get email customization settings for colors
$email_settings = get_option('woonoow_email_settings', []);
$primary_color = $email_settings['primary_color'] ?? '#7f54b3';
$secondary_color = $email_settings['secondary_color'] ?? '#7f54b3';
$button_text_color = $email_settings['button_text_color'] ?? '#ffffff';
$hero_gradient_start = $email_settings['hero_gradient_start'] ?? '#667eea';
$hero_gradient_end = $email_settings['hero_gradient_end'] ?? '#764ba2';
$hero_text_color = $email_settings['hero_text_color'] ?? '#ffffff';
// Use unified colors from Appearance > General > Colors
$appearance = get_option('woonoow_appearance_settings', []);
$colors = $appearance['general']['colors'] ?? [];
$primary_color = $colors['primary'] ?? '#7f54b3';
$secondary_color = $colors['secondary'] ?? '#7f54b3';
$button_text_color = '#ffffff'; // Always white on primary buttons
$hero_gradient_start = $colors['gradientStart'] ?? '#667eea';
$hero_gradient_end = $colors['gradientEnd'] ?? '#764ba2';
$hero_text_color = '#ffffff'; // Always white on gradient
// Parse button shortcodes with FULL INLINE STYLES for Gmail compatibility
// Helper function to generate button HTML