-- Forgot password email template (additive; safe if full patch already applied) INSERT INTO notification_templates ( code, name, channel, subject, html_body, placeholders, description, is_active ) VALUES ( 'FORGOT_PASSWORD', 'Forgot Password Reset', 'EMAIL', 'Reset your ERP password', '
Hello {{user_name}},
We received a request to reset your password.
Click here to reset your password
This link expires in {{expiry_minutes}} minutes.
If the button does not work, open this link:
{{reset_url}}
If you did not request this, you can ignore this email.
', '[ {"key": "user_name", "description": "User full name"}, {"key": "reset_url", "description": "Password reset frontend URL with token"}, {"key": "expiry_minutes", "description": "Reset link expiry in minutes"} ]'::jsonb, 'Sent when a user requests a password reset via forgot-password', true ) ON CONFLICT (code) DO UPDATE SET name = EXCLUDED.name, channel = EXCLUDED.channel, subject = EXCLUDED.subject, html_body = EXCLUDED.html_body, placeholders = EXCLUDED.placeholders, description = EXCLUDED.description, is_active = true, deleted_at = NULL, updated_at = NOW();