How sachnaror/email_shooter works
Project Type and Purpose
• This is a Django‐based backend automation tool (“The Ultimate Email Ninja”) whose sole purpose is to send personalized, tracked emails in scheduled batches. It leverages:
• Django (email_shooter project + app1 Django app)
• Celery workers (asynchronous task queue)
• Redis (broker + potential runtime store)
• OpenAI API (dynamic content)
• Mailgun (SMTP/email sending via rotating proxies)
• Simple file stores (email_ids.txt, email_content.txt)
• No traditional “frontend” beyond a small Django view to trigger email sends and serve the tracking pixel.
File Structure
• Top level
• manage.py – Django CLI entrypoint
• requirements.txt – Python dependencies
• dump.rdb – Redis data dump
• email_ids.txt, email_content.txt – input data files
• test_send_email.py – end‐to‐end test
• email_shooter/ (Django project)
• asgi.py, wsgi.py – server interfaces
• celery_app.py – Celery configuration & beat scheduling
• urls.py – endpoint mappings
• app1/ (Django app)
• tasks.py – Celery tasks: read files, call OpenAI, send emails, cleanup
• views.py – HTTP views: start_email_sending endpoint & tracking pixel handler
• models.py – DB models for logs & open‐tracking
• utils.py – helper routines: dynamic content generation, random sender selection
• migrations/ – DB schema
• Celery + Redis handle scheduling and queueing, Django handles web endpoints & persistence.
Extracted Architecture Insights from README
• Core flow:
1. Trigger “start_email_sending” via HTTP
2. Celery beat schedules recurring send tasks every 6h
3. Task reads email IDs & content from flat files
4. Calls OpenAI to vary content & subject
5. Randomly selects Mailgun sender + proxy IP
6. Dispatches email, logs to models (DB)
7. Embeds tracking pixel URL pointing to a Django view
8. If recipient never opens, they’re pruned from the list
• External dependencies: OpenAI, Mailgun API, proxy services
Essential Details
• “6-hour” periodic schedule on Celery Beat
• “max 50 emails/day” rule near task logic
• “prune non-openers” step between tracking and next batch
• Paths: /start_email_sending/, /track/<id>