Domain deep dive — Automation & communications
Purpose
Section titled “Purpose”Single D1 narrative for engineers changing transactional email, notification behavior, or DocuSign send queues. It ties together:
- Generated Automation & communications DocType reference pages
- Schedulers —
generate_auto_emails_all(0 8 * * *) - Doc events — disabled
Auto Email Configurationon_updaterefresh (commented) - DocuSign and Billing flow (template selection via Email Templates Configuration)
Domain boundary
Section titled “Domain boundary”| In scope | Out of scope (link instead) |
|---|---|
| Auto Email rules, Email Templates Configuration, Mandrill settings/logs | In-app Chat / unrelated messaging products |
| DocuSign Email Queue (+ child tables) | DocuSign account billing — vendor console |
| Email Notification / Notification LKA | Full marketing ESP strategy |
| Frappe Email Queue behavior | Upstream Frappe mail tuning — ERPNext docs |
DocType cluster (generated)
Section titled “DocType cluster (generated)”| Sub-theme | Examples |
|---|---|
| Auto email | auto_email_configuration, auto_emails, auto_email_active, auto_email_company_types, auto_email_cron_log |
| Templates | email_templates_configuration |
| Mandrill | mandrill_email_settings, mandrill_email_log |
| DocuSign outbound | docusign_email_queue, docusign_email_queue_document, docusign_email_queue_recipient |
| Generic | email_data, email_notification, email_notification_log, notification_lka |
Index: automation-comms.
Code map
Section titled “Code map”| Layer | Primary locations |
|---|---|
| Scheduled generation | tasks.py — generate_auto_emails_all (see Schedulers) |
| Billing emails | tasks.py — handle_billing, send_payment_success_email → Email Templates Configuration by service_type (Billing flow) |
| DocuSign | api/docusign.py, DocuSign Email Queue controllers |
| Hooks (disabled) | hooks.py — Auto Email Configuration on_update → refresh_application_email_config commented (Doc events) |
Flow (scheduled auto emails)
Section titled “Flow (scheduled auto emails)”Overlay priority (for overlays.json)
Section titled “Overlay priority (for overlays.json)”| Priority | DocType keys | Rationale |
|---|---|---|
| P1 — Overlays present | auto_email_configuration, email_templates_configuration, docusign_email_queue | Core routing, templates, DocuSign pipeline |
| P2 | auto_emails, mandrill_email_settings, email_notification, notification_lka | Volume and provider-specific debugging |
| P3 | Child tables (docusign_email_queue_*), auto_email_cron_log, mandrill_email_log | Trace rows; overlay if support load is high |
Failure modes (where to look)
Section titled “Failure modes (where to look)”| Symptom | First checks |
|---|---|
| No auto emails at 08:00 | Scheduler running; Error Log in generate_auto_emails_all; Schedulers |
| Wrong template after Billing | Email Templates Configuration service_type and Billing fields (Billing flow) |
| DocuSign stuck | DocuSign Email Queue status, api/docusign.py, provider dashboard |
| AGM + email regressions | Do not re-enable broken AGM on_update auto-email without AGM & scheduler sign-off |
Logs: Frappe Error Log, Email Queue, Mandrill logs DocType, Scheduled Job Log.
Related
Section titled “Related”- Engineering deliverables — governance policies (orthogonal to this domain narrative)
- DocuSign
- Domain deep dive — Corporate AGM — scheduler interaction with auto-email history
- Domain documentation strategy
- Documentation upgrade roadmap