# ygseo2020/email-system architecture

> Architecture diagram of the GitHub repository ygseo2020/email-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ygseo2020/email-system
- Repository: https://github.com/ygseo2020/email-system

## Overview

This is a Streamlit bulk-email application: a user uploads company data, selects recipients, reviews personalized messages, and sends them through Gmail. It also supports editable templates, image placement, and optional Google Forms links or form creation. The product is implemented in one file; the graph separates its domain responsibilities, not separate packages. The excerpts show workbook loading, preview composition, form creation, and SMTP setup, but omit some intervening code, so unshown handoffs are not inferred.

Main entry points: [`auto_em.py`](https://github.com/ygseo2020/email-system/blob/main/auto_em.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Email workflow"]
  node_app["Streamlit app<br/>[auto_em.py]"]
  node_intake["Workbook intake<br/>[auto_em.py]"]
  node_recipients["Recipient selection<br/>[auto_em.py]"]
  node_preview["Final preview<br/>[auto_em.py]"]
  node_sender_settings["Sender settings<br/>[auto_em.py]"]
end

subgraph group_content["Message content"]
  node_templates["Email templates<br/>[auto_em.py]"]
  node_composer["Email composer<br/>[auto_em.py]"]
end

subgraph group_integrations["External integrations"]
  node_form_setup["Form setup<br/>[auto_em.py]"]
  node_google_forms["Google Forms API"]
  node_delivery["SMTP delivery<br/>[auto_em.py]"]
  node_gmail_smtp["Gmail SMTP"]
end

node_user(("Email operator"))

node_user -->|"operates"| node_app
node_app -->|"loads workbook"| node_intake
node_app -->|"edits recipients"| node_recipients
node_app -->|"configures sender"| node_sender_settings
node_app -->|"edits templates"| node_templates
node_preview -->|"calls builder"| node_composer
node_composer -.->|"renders templates"| node_templates
node_form_setup -->|"creates form"| node_google_forms
node_composer -->|"reads form state"| node_form_setup
node_delivery -->|"connects and logs in"| node_gmail_smtp

click node_app "https://github.com/ygseo2020/email-system/blob/main/auto_em.py"
click node_intake "https://github.com/ygseo2020/email-system/blob/main/auto_em.py"
click node_recipients "https://github.com/ygseo2020/email-system/blob/main/auto_em.py"
click node_preview "https://github.com/ygseo2020/email-system/blob/main/auto_em.py"
click node_sender_settings "https://github.com/ygseo2020/email-system/blob/main/auto_em.py"
click node_templates "https://github.com/ygseo2020/email-system/blob/main/auto_em.py"
click node_composer "https://github.com/ygseo2020/email-system/blob/main/auto_em.py"
click node_form_setup "https://github.com/ygseo2020/email-system/blob/main/auto_em.py"
click node_delivery "https://github.com/ygseo2020/email-system/blob/main/auto_em.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_intake,node_recipients,node_preview,node_sender_settings toneBlue
class node_templates,node_composer toneAmber
class node_form_setup,node_google_forms,node_delivery,node_gmail_smtp toneMint
class node_user toneIndigo
```

## Components

### Email workflow

- [Streamlit app](https://github.com/ygseo2020/email-system/blob/main/auto_em.py): `auto_em.py`
- [Workbook intake](https://github.com/ygseo2020/email-system/blob/main/auto_em.py): `auto_em.py`
- [Recipient selection](https://github.com/ygseo2020/email-system/blob/main/auto_em.py): `auto_em.py`
- [Final preview](https://github.com/ygseo2020/email-system/blob/main/auto_em.py): `auto_em.py`
- [Sender settings](https://github.com/ygseo2020/email-system/blob/main/auto_em.py): `auto_em.py`

### Message content

- [Email templates](https://github.com/ygseo2020/email-system/blob/main/auto_em.py): `auto_em.py`
- [Email composer](https://github.com/ygseo2020/email-system/blob/main/auto_em.py): `auto_em.py`

### External integrations

- [Form setup](https://github.com/ygseo2020/email-system/blob/main/auto_em.py): `auto_em.py`
- **Google Forms API**
- [SMTP delivery](https://github.com/ygseo2020/email-system/blob/main/auto_em.py): `auto_em.py`
- **Gmail SMTP**

### Other components

- **Email operator**

## Connections

- Email operator → Streamlit app: operates (evidence: `auto_em.py`)
- Streamlit app → Workbook intake: loads workbook (evidence: `auto_em.py`)
- Streamlit app → Recipient selection: edits recipients (evidence: `auto_em.py`)
- Streamlit app → Sender settings: configures sender (evidence: `auto_em.py`)
- Streamlit app → Email templates: edits templates (evidence: `auto_em.py`)
- Final preview → Email composer: calls builder (evidence: `auto_em.py`)
- Email composer → Email templates: renders templates (evidence: `auto_em.py`)
- Form setup → Google Forms API: creates form (evidence: `auto_em.py`)
- Email composer → Form setup: reads form state (evidence: `auto_em.py`)
- SMTP delivery → Gmail SMTP: connects and logs in (evidence: `auto_em.py`)
