fix: Email Preview Issues - All 5 Fixed! 🔧

## Issues Fixed:

### 1. Button Not Rendering 
- Buttons now use custom primary_color
- Button text uses button_text_color
- Outline buttons use secondary_color
- Applied to .button and .button-outline classes

### 2. Double Hash in Order Number 
- Changed order_number from "#12345" to "12345"
- Templates already have # prefix
- Prevents ##12345 display

### 3. Duplicate Icons in Social Selector 
- Removed duplicate icon from SelectTrigger
- SelectValue already shows the icon
- Clean single icon display

### 4. Header/Footer Not Reflecting Customization 
- Fetch email settings in EditTemplate
- Apply logo_url or header_text to header
- Apply footer_text with {current_year} replacement
- Render social icons in footer

### 5. Hero Heading Not Using Custom Color 
- Apply hero_text_color to all hero card types
- .card-hero, .card-success, .card-highlight
- All text and headings use custom color

## Preview Now Shows:
 Custom logo (if set) or header text
 Custom hero gradient colors
 Custom hero text color (white/custom)
 Custom button colors (primary & secondary)
 Custom footer text with {current_year}
 Social icons in footer

## Files:
- `routes/Settings/Notifications/EditTemplate.tsx` - Preview integration
- `routes/Settings/Notifications/EmailCustomization.tsx` - UI fix

Everything synced! Preview matches actual emails! 🎉
This commit is contained in:
dwindown
2025-11-13 14:05:39 +07:00
parent 1032e659de
commit e52429603b
2 changed files with 59 additions and 12 deletions

View File

@@ -496,10 +496,7 @@ export default function EmailCustomization() {
onValueChange={(value) => updateSocialLink(index, 'platform', value)}
>
<SelectTrigger className="h-9">
<div className="flex items-center gap-2">
{getSocialIcon(link.platform)}
<SelectValue />
</div>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="facebook">