Description
When designing campaigns, sales representatives want to test the email sequences before sending them to actual clients. Currently, launching a campaign sends actual emails to the lead addresses. We need a "Sandbox Mode" switch in Campaign settings to redirect all emails to a test inbox.
User & Contributor Value
- Contributors: Condition-based workflow dispatching, reading and applying campaign-level settings, and email redirection logic.
- Users: Allows safely testing complex multi-step email flows with dummy leads without spamming real customers.
Code Locations
- backend/campaigns/models.py
- backend/campaigns/tasks.py
Implementation Guide
- Extend Settings Schema: Add a
sandbox_mode checkbox parameter inside the campaign settings JSON field.
- Task Interception: In
send_email_step task, check if campaign.settings.get('sandbox_mode') is True.
- Redirect Delivery: If enabled, override the recipient email (
clead.lead.email) and send the email to the logged-in user's address instead, appending [TEST SANDBOX] to the subject line.
Description
When designing campaigns, sales representatives want to test the email sequences before sending them to actual clients. Currently, launching a campaign sends actual emails to the lead addresses. We need a "Sandbox Mode" switch in Campaign settings to redirect all emails to a test inbox.
User & Contributor Value
Code Locations
Implementation Guide
sandbox_modecheckbox parameter inside the campaign settings JSON field.send_email_steptask, check ifcampaign.settings.get('sandbox_mode')is True.clead.lead.email) and send the email to the logged-in user's address instead, appending[TEST SANDBOX]to the subject line.