feat: add spintax support for email templates#310
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA ChangesSpintax Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/campaigns/utils.py`:
- Around line 23-33: The regex pattern variable `pattern` on line 23 is too
broad and matches any text within braces. Modify the pattern to only match true
Spintax blocks that contain the pipe character (|), ensuring it requires at
least one pipe separator within the braces. This way, only valid Spintax
alternatives like {option1|option2} will be processed, while other braced
content such as unresolved merge tags or literal braces remain untouched and
their content is not accidentally mutated.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8370fcba-5e4e-4efd-9dc0-5290da90af70
📒 Files selected for processing (2)
backend/campaigns/tasks.pybackend/campaigns/utils.py
Summary
Adds Spintax support for email templates.
Closes #122
Changes
parse_spintaximport incampaigns/tasks.pycampaigns/utils.pyTesting
Notes
This PR contains only the Spintax-related backend changes and excludes unrelated frontend formatting changes and merge-conflict resolutions.
Summary by CodeRabbit
Release Notes
{option1|option2|...}variants.