fix: add migration to update existing tier change template (refs #59)
Some checks failed
Deploy to Staging / Build Images (pull_request) Successful in 3m4s
Deploy to Staging / Deploy to Staging (pull_request) Has been cancelled
Deploy to Staging / Verify Staging (pull_request) Has been cancelled
Deploy to Staging / Notify Staging Ready (pull_request) Has been cancelled
Deploy to Staging / Notify Staging Failure (pull_request) Has been cancelled

The original migration already inserted the template with Handlebars conditionals.
This migration updates the existing record to use simple variable substitution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Eric Gullickson
2026-01-31 20:21:17 -06:00
parent 86b2e46798
commit 706851f396

View File

@@ -0,0 +1,26 @@
/**
* Migration: Fix subscription tier change email template
* @ai-summary Fixes template to use simple variable substitution instead of conditionals
* @ai-context TemplateService only supports {{variable}}, not Handlebars conditionals
*/
-- Update the existing template to use simple variable substitution
UPDATE email_templates
SET
body = 'Hi {{userName}},
Your MotoVaultPro subscription has been {{changeType}}.
Previous Tier: {{previousTier}}
New Tier: {{newTier}}
Reason: {{reason}}
{{additionalInfo}}
If you have any questions, please contact support.
Best regards,
MotoVaultPro Team',
variables = '["userName", "changeType", "previousTier", "newTier", "reason", "additionalInfo"]',
updated_at = NOW()
WHERE template_key = 'subscription_tier_change';