A comprehensive email campaign management system with personalization, tracking, and compliance features for managing outreach across multiple sectors.
This repository provides a complete solution for managing personalized email campaigns with built-in tracking, compliance checking, and response handling. It supports multiple industry sectors including education, finance, and healthcare.
- Multi-Sector Campaign Management: Pre-configured templates for education, finance, and healthcare sectors
- Email Personalization: Dynamic content replacement using contact data
- Compliance Checking: Built-in validation against regulatory requirements
- Campaign Tracking: Comprehensive analytics and response monitoring
- Unsubscribe Management: Automated handling of opt-out requests
- DOCX Template Processing: Parse and personalize Microsoft Word templates
- Rate Limiting: Smart throttling to prevent email service overload
- GitHub Integration: Automated notifications and workflow management
services/
βββ campaign-templates/ # Email templates by sector
β βββ education/ # Education sector templates
β βββ finance/ # Finance sector templates
β βββ healthcare/ # Healthcare sector templates
βββ contact-details/ # Organized contact information
βββ contacts/ # CSV contact databases
βββ scheduled-campaigns/ # Campaign configurations
βββ tracking/ # Campaign analytics and responses
βββ utils/ # Core utilities and tools
βββ debug/ # Debugging and diagnostics
- Python 3.13+
- SMTP server credentials
- Microsoft Word (.docx) template files
- Clone the repository:
git clone https://github.com/sednabcn/services.git
cd services- Install dependencies:
pip install -r requirements.txt- Configure compliance settings:
# Edit compliance_config.json with your regulatory requirementsCreate or modify compliance_config.json to set your compliance rules, SMTP settings, and campaign parameters.
# Use the integrated runner for complete campaign execution
python utils/integrated_runner.py
# Or use the email campaign system directly
python utils/email_campaign_system.py- Place your
.docxtemplate in the appropriate sector folder undercampaign-templates/ - Use placeholder syntax:
{{FirstName}},{{Company}}, etc. - Run the validator to check template compliance:
python utils/campaign_validator.py- Add contacts to CSV files in the
contacts/directory - Organize sector-specific contacts in
contact-details/ - Validate contact data:
python utils/contact_validator.pyCampaign data is automatically tracked in tracking/default/:
campaigns/- Campaign metadata and configurationsanalytics/- Performance metricsresponses/- Reply trackingunsubscribed.json- Opt-out list
email_personalizer.py- Personalize email contentemail_sender.py- Send emails with rate limitingreply_handler.py- Process incoming repliesunsubscribe_manager.py- Handle opt-out requests
docx_parser.py- Parse Word documents with compliancedocx_validator.py- Validate document structurefix_corrupted_docx.py- Repair damaged Word files
campaign_summary.py- Generate campaign reportscampaign_diagnostics.py- Troubleshoot issuessmart_rate_limit.py- Intelligent email throttling
github_adapter.py- GitHub API integrationgithub_notifier.py- Automated GitHub notifications
The system automatically tracks:
- Email delivery status
- Open rates and engagement
- Response handling
- Unsubscribe requests
- Campaign performance metrics
Access analytics in tracking/default/analytics/
Built-in compliance features:
- GDPR consent validation
- CAN-SPAM compliance checking
- Unsubscribe link enforcement
- Data protection validation
Configure compliance rules in compliance_config.json
Diagnostic tools available in utils/:
campaign_diagnostics.py- Full system diagnosticsdocx_diagnostic.py- Document parsing issuestest-smtp-local.py- SMTP configuration testingfind_substitution_bug.py- Template variable issues
Pre-built templates for:
- Education: Adult education institutions, universities
- Finance: Banks and financial services
- Healthcare: Medical facilities and providers
Each sector includes customized outreach templates with appropriate tone and compliance.
GitHub Actions workflows included for:
- Cleanup of old workflow runs
- Daily CSV file cleaning
- Enhanced email campaign production
- Automated testing and validation
See LICENSE file for details.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
For issues and questions:
- Check the debug logs in
log.txt - Review campaign diagnostics
- Consult the compliance configuration
- Always test campaigns with small batches first
- Maintain an up-to-date suppression list
- Respect unsubscribe requests immediately
- Follow all applicable email marketing regulations
- Backup contact data regularly
Regular maintenance tasks:
- Clean old campaign data with
cleanup_duplicates.py - Validate contact lists periodically
- Update compliance rules as regulations change
- Monitor rate limits and adjust as needed
- Review and archive old campaigns