# mrstzz/php-blastmail architecture

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

- Interactive diagram: https://gitdiagram.com/mrstzz/php-blastmail
- Repository: https://github.com/mrstzz/php-blastmail

## Overview

BlastMail is a Laravel email-campaign manager. Users register, maintain contact lists and templates, configure and schedule campaigns, then inspect delivery, opening, click, and aggregate metrics. CampaignController is the sampled workflow orchestrator; queued jobs fan out campaign mail to subscribers, while mail generation rewrites links for tracking. The README documents authentication, soft-delete restoration, tracking, and statistics. Some controllers and route wiring were not sampled, so those links are omitted or marked unverified rather than inferred.

Main entry points: [`app/Http/Controllers/CampaignController.php`](https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/CampaignController.php) (Campaign workflow), [`app/Jobs/SendEmailCampaignJob.php`](https://github.com/mrstzz/php-blastmail/blob/main/app/Jobs/SendEmailCampaignJob.php) (Subscriber delivery), [`app/Mail/EmailCampaign.php`](https://github.com/mrstzz/php-blastmail/blob/main/app/Mail/EmailCampaign.php) (Campaign email), [`app/Models/EmailList.php`](https://github.com/mrstzz/php-blastmail/blob/main/app/Models/EmailList.php) (List model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts"]
  node_registration["Registration"]
  node_authentication["Authentication"]
  node_user_model["User account<br/>[User.php]"]
  node_profile["Profile settings"]
end

subgraph group_audience["Audience and content"]
  node_list_management["Email lists"]
  node_subscriber_management["Subscribers"]
  node_template_management["Templates"]
  node_email_list["List model<br/>[EmailList.php]"]
  node_subscriber["Subscriber model<br/>[Subscriber.php]"]
  node_template["Template model<br/>[Template.php]"]
end

subgraph group_campaigns["Campaign management"]
  node_campaign_workflow["Campaign workflow"]
  node_campaign["Campaign model<br/>[Campaign.php]"]
end

subgraph group_delivery["Delivery and engagement"]
  node_queue_dispatch["Campaign fan-out"]
  node_mail_dispatch["Subscriber delivery"]
  node_campaign_mail["Campaign recipient record<br/>[CampaignMail.php]"]
  node_email_message["Campaign email<br/>[EmailCampaign.php]"]
  node_mail_transport(("Mail transport"))
  node_tracking["Open and click tracking"]
  node_metrics["Campaign metrics<br/>[CampaignMail.php]"]
end

node_user(("User"))

node_user -->|"registers"| node_registration
node_registration -->|"creates account"| node_user_model
node_user -->|"signs in"| node_authentication
node_user -.->|"manages lists"| node_list_management
node_list_management -->|"uses model"| node_email_list
node_subscriber_management -->|"loads list"| node_email_list
node_subscriber_management -->|"manages records"| node_subscriber
node_template_management -->|"manages templates"| node_template
node_user -.->|"configures campaign"| node_campaign_workflow
node_campaign_workflow -->|"loads lists"| node_email_list
node_campaign_workflow -->|"loads templates"| node_template
node_campaign_workflow -->|"creates and queries"| node_campaign
node_campaign_workflow -->|"dispatches after response"| node_queue_dispatch
node_campaign_workflow -->|"queries statistics"| node_metrics
node_campaign_workflow -.->|"manages profile"| node_profile
node_queue_dispatch -->|"dispatches per recipient"| node_mail_dispatch
node_mail_dispatch -->|"loads campaign"| node_campaign
node_mail_dispatch -->|"loads recipient"| node_subscriber
node_mail_dispatch -->|"records delivery"| node_campaign_mail
node_mail_dispatch -->|"sends message"| node_email_message
node_email_message -.->|"delivers through"| node_mail_transport
node_email_message -->|"rewrites click links"| node_tracking
node_tracking -.->|"records engagement"| node_campaign_mail
node_metrics -->|"aggregates recipient data"| node_campaign_mail
node_campaign_workflow -->|"restores soft-deleted"| node_campaign

click node_registration "https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_authentication "https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_user_model "https://github.com/mrstzz/php-blastmail/blob/main/app/Models/User.php"
click node_list_management "https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/EmailListController.php"
click node_subscriber_management "https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/SubscriberController.php"
click node_template_management "https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/TemplateController.php"
click node_email_list "https://github.com/mrstzz/php-blastmail/blob/main/app/Models/EmailList.php"
click node_subscriber "https://github.com/mrstzz/php-blastmail/blob/main/app/Models/Subscriber.php"
click node_template "https://github.com/mrstzz/php-blastmail/blob/main/app/Models/Template.php"
click node_campaign_workflow "https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/CampaignController.php"
click node_campaign "https://github.com/mrstzz/php-blastmail/blob/main/app/Models/Campaign.php"
click node_profile "https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/ProfileController.php"
click node_queue_dispatch "https://github.com/mrstzz/php-blastmail/blob/main/app/Jobs/SendEmailsCampaignJob.php"
click node_mail_dispatch "https://github.com/mrstzz/php-blastmail/blob/main/app/Jobs/SendEmailCampaignJob.php"
click node_campaign_mail "https://github.com/mrstzz/php-blastmail/blob/main/app/Models/CampaignMail.php"
click node_email_message "https://github.com/mrstzz/php-blastmail/blob/main/app/Mail/EmailCampaign.php"
click node_tracking "https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/TrackingController.php"
click node_metrics "https://github.com/mrstzz/php-blastmail/blob/main/app/Models/CampaignMail.php"

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_registration,node_authentication,node_user_model,node_profile,node_user toneBlue
class node_list_management,node_subscriber_management,node_template_management,node_email_list,node_subscriber,node_template toneAmber
class node_campaign_workflow,node_campaign toneMint
class node_queue_dispatch,node_mail_dispatch,node_campaign_mail,node_email_message,node_mail_transport,node_tracking,node_metrics toneRose
```

## Components

### Accounts

- [Registration](https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Authentication](https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [User account](https://github.com/mrstzz/php-blastmail/blob/main/app/Models/User.php): `app/Models/User.php`
- [Profile settings](https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/ProfileController.php): `app/Http/Controllers/ProfileController.php`

### Audience and content

- [Email lists](https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/EmailListController.php): `app/Http/Controllers/EmailListController.php`
- [Subscribers](https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/SubscriberController.php): `app/Http/Controllers/SubscriberController.php`
- [Templates](https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/TemplateController.php): `app/Http/Controllers/TemplateController.php`
- [List model](https://github.com/mrstzz/php-blastmail/blob/main/app/Models/EmailList.php): `app/Models/EmailList.php`
- [Subscriber model](https://github.com/mrstzz/php-blastmail/blob/main/app/Models/Subscriber.php): `app/Models/Subscriber.php`
- [Template model](https://github.com/mrstzz/php-blastmail/blob/main/app/Models/Template.php): `app/Models/Template.php`

### Campaign management

- [Campaign workflow](https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/CampaignController.php): `app/Http/Controllers/CampaignController.php`
- [Campaign model](https://github.com/mrstzz/php-blastmail/blob/main/app/Models/Campaign.php): `app/Models/Campaign.php`

### Delivery and engagement

- [Campaign fan-out](https://github.com/mrstzz/php-blastmail/blob/main/app/Jobs/SendEmailsCampaignJob.php): `app/Jobs/SendEmailsCampaignJob.php`
- [Subscriber delivery](https://github.com/mrstzz/php-blastmail/blob/main/app/Jobs/SendEmailCampaignJob.php): `app/Jobs/SendEmailCampaignJob.php`
- [Campaign recipient record](https://github.com/mrstzz/php-blastmail/blob/main/app/Models/CampaignMail.php): `app/Models/CampaignMail.php`
- [Campaign email](https://github.com/mrstzz/php-blastmail/blob/main/app/Mail/EmailCampaign.php): `app/Mail/EmailCampaign.php`
- **Mail transport**
- [Open and click tracking](https://github.com/mrstzz/php-blastmail/blob/main/app/Http/Controllers/TrackingController.php): `app/Http/Controllers/TrackingController.php`
- [Campaign metrics](https://github.com/mrstzz/php-blastmail/blob/main/app/Models/CampaignMail.php): `app/Models/CampaignMail.php`

### Other components

- **User**

## Connections

- User → Registration: registers (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Registration → User account: creates account (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- User → Authentication: signs in
- User → Email lists: manages lists
- Email lists → List model: uses model (evidence: `app/Http/Controllers/EmailListController.php`)
- Subscribers → List model: loads list (evidence: `app/Http/Controllers/SubscriberController.php`)
- Subscribers → Subscriber model: manages records (evidence: `app/Http/Controllers/SubscriberController.php`)
- Templates → Template model: manages templates (evidence: `app/Http/Controllers/TemplateController.php`)
- User → Campaign workflow: configures campaign
- Campaign workflow → List model: loads lists (evidence: `app/Http/Controllers/CampaignController.php`)
- Campaign workflow → Template model: loads templates (evidence: `app/Http/Controllers/CampaignController.php`)
- Campaign workflow → Campaign model: creates and queries (evidence: `app/Http/Controllers/CampaignController.php`)
- Campaign workflow → Campaign fan-out: dispatches after response (evidence: `app/Http/Controllers/CampaignController.php`)
- Campaign workflow → Campaign metrics: queries statistics (evidence: `app/Http/Controllers/CampaignController.php`)
- Campaign workflow → Profile settings: manages profile
- Campaign fan-out → Subscriber delivery: dispatches per recipient (evidence: `app/Jobs/SendEmailsCampaignJob.php`)
- Subscriber delivery → Campaign model: loads campaign (evidence: `app/Jobs/SendEmailCampaignJob.php`)
- Subscriber delivery → Subscriber model: loads recipient (evidence: `app/Jobs/SendEmailCampaignJob.php`)
- Subscriber delivery → Campaign recipient record: records delivery (evidence: `app/Jobs/SendEmailCampaignJob.php`)
- Subscriber delivery → Campaign email: sends message (evidence: `app/Jobs/SendEmailCampaignJob.php`)
- Campaign email → Mail transport: delivers through
- Campaign email → Open and click tracking: rewrites click links (evidence: `app/Mail/EmailCampaign.php`)
- Open and click tracking → Campaign recipient record: records engagement
- Campaign metrics → Campaign recipient record: aggregates recipient data (evidence: `app/Models/CampaignMail.php`)
- Campaign workflow → Campaign model: restores soft-deleted (evidence: `app/Http/Controllers/CampaignController.php`)
