Generate mailshots from wordpress environment
Go to file
Adrian Stephens 1835e75924 HTML editor work 2026-04-22 09:06:03 +01:00
credentials Initial commit 2026-04-21 10:49:33 +01:00
docs Initial commit 2026-04-21 10:49:33 +01:00
feca_mailshots_plugin HTML editor work 2026-04-22 09:06:03 +01:00
requirements HTML editor work 2026-04-22 09:06:03 +01:00
results Initial commit 2026-04-21 10:49:33 +01:00
samples HTML editor work 2026-04-22 09:06:03 +01:00
scripts Initial commit 2026-04-21 10:49:33 +01:00
tests HTML editor work 2026-04-22 09:06:03 +01:00
tools Initial commit 2026-04-21 10:49:33 +01:00
.codex Initial commit 2026-04-21 10:49:33 +01:00
.gitignore HTML editor work 2026-04-22 09:06:03 +01:00
README.md Initial commit 2026-04-21 10:49:33 +01:00
composer.json Initial commit 2026-04-21 10:49:33 +01:00
composer.lock Initial commit 2026-04-21 10:49:33 +01:00
package-lock.json HTML editor work 2026-04-22 09:06:03 +01:00
package.json HTML editor work 2026-04-22 09:06:03 +01:00
playwright.config.mjs HTML editor work 2026-04-22 09:06:03 +01:00

README.md

FECA Mailshots Plugin

WordPress plugin project for defining, previewing, testing, and running mailshots using:

  • data-source definitions stored in a mailshots database,
  • recipient/source reads from a separate members database,
  • per-user SMTP/IMAP credentials for send and sent-copy behavior.

Repository Overview

  • feca_mailshots_plugin/: plugin source code.
  • requirements/: project requirements/specifications.
  • tests/: integration/unit/fixture tests.
  • scripts/: local helper scripts (deploy, tunnel, fixture server).
  • credentials/: local development credentials (ignored in Git).
  • results/: implementation notes and investigation outputs.

Key Features

  • WordPress admin navigation under FECA Mailshots.
  • CRUD admin pages for:
    • Mailshots
    • Data Sources
    • Attachments
    • PDF Assets
  • Profile page for per-user SMTP/IMAP credentials with explicit connection tests.
  • Setup page for environment DB connection settings (admin-only).
  • Mailshot Test and Run pages for render/send execution.
  • DSL-based data source model with validation and preview.
  • REST and admin-post APIs for data source operations.

Runtime Data Routing

As defined in requirements/environment.md:

  • Write-path tables (mailshot definitions/assets/run data): MAILSHOTS_REMOTE_MYSQL_DB
  • Read-path recipient/source data: MEMBERS_REMOTE_MYSQL_DB

Local Setup

  1. Copy env template:
    • cp credentials/.env.example credentials/.env
  2. Populate real values in credentials/.env.
  3. Start MySQL tunnel (if required):
    • scripts/mysql_tunnel.sh start
  4. (Optional) run fixture server:
    • scripts/run_fixture_server.sh start

Testing

Examples:

  • php tests/integration/test_phase2_db_access.php
  • php tests/integration/test_phase3_admin_crud_ui.php
  • php tests/integration/test_phase3_db_access.php
  • php tests/integration/test_phase4_run_flow.php
  • php tests/integration/test_per_user_credentials.php

Deployment

  • Deploy script: scripts/deploy_remote.sh
  • Supports dry run:
    • scripts/deploy_remote.sh --dry-run
  • Deployment script bumps plugin patch version automatically before real deploy.

Security Notes

  • Do not commit secrets.
  • credentials/.env and key material are ignored by .gitignore.
  • Per-user mail credentials are stored encrypted in the mailshots DB.

Important References

  • Environment baseline: requirements/environment.md
  • Mailshot requirements: requirements/mailshot.md
  • Data source requirements: requirements/mailshot_data_source.md