You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Core]: Fix EmailTemplateType enum — document types, not field types #667
Modules/Core/Enums/EmailTemplateType.php currently declares TEXT/NUMBER/DATE/BOOLEAN with labels like "Single Line Text" and "Date Picker" — custom-field types pasted into the email-template enum. The intended domain (//'invoice', 'quote', 'payment', 'reminder') survives only as a comment. Every consumer that must filter templates by document type (#164 quote templates, #400 auto-send, #480 reminders, status-aware selection) is blocked; today InvoiceService::resolveEmailDefaults() works around it by matching on the magic title invoice_sent.
v1 spec: email_template_type column with values invoice/quote, filtered in application/modules/mailer/controllers/Mailer.php:83,141.
Specific
Enum cases become INVOICE='invoice', QUOTE='quote', PAYMENT='payment', REMINDER='reminder' with sensible labels/colors.
Data migration maps existing rows: seeded titles invoice_sent→invoice, quote_sent→quote, payment_received→payment, user_invitation→ nullable/system (decide: add SYSTEM case or leave type nullable).
EmailTemplateForm type select and EmailTemplatesTable badge use the new cases.
InvoiceService::resolveEmailDefaults() filters type = INVOICE (keeping title fallback for back-compat this release).
Measurable
No code path references TEXT/NUMBER/DATE/BOOLEAN on email templates; template pickers list only same-type templates.
Achievable
Enum + migration + two Filament touch points + one service filter; EmailTemplateFactory/seeder updated in the same PR (factory-schema contract).
Activity