The Email Campaigns & Automations (ECA) module is a core component of the SaleGen Marketing Toolkit plugin. It provides a structured and predictable system for sending one-time email campaigns and building automated, step-based email flows.
The module is tightly integrated with the Contacts module and uses contact data, tags, and custom fields to control delivery logic and automation behavior.
ECA is designed for environments where full control over email logic, timing, and data ownership is required. All processes are executed inside WordPress using queued processing.
Create one-time email campaigns and multi-step automated email chains.
Build automations using Chains (Flows) and Steps, executed sequentially.
Define entry and exit conditions for each chain.
Apply time-based delivery rules (allowed days and hours).
Configure step-level conditions, delays, retries, and looping.
Use a visual block-based email builder similar to Elementor or WPBakery.
Reuse global email templates across multiple chains.
Dynamically load latest posts into emails at generation time.
Automatically add or remove contact tags based on email events.
Track execution with detailed flows, logs, statistics, and email events.
Queue-based delivery powered by WP_CRON (recommended: real cron every 1 minute).
Built with frontend and backend validation to ensure reliable execution.
A Chain (also referred to as a Flow) represents an automation sequence.
Each chain contains one or more Steps, executed in order.
Chains are responsible for:
Determining who enters the automation.
Determining when execution stops.
Defining global rules that apply to all steps.
Entry conditions define whether a contact is allowed to enter a chain.
All entry conditions are evaluated using the AND operator.
Supported entry rules include:
Contact verification status.
Required tags (at least one).
Forbidden tags (at least one).
Contact field conditions with configurable operators.
Only contacts that match all entry conditions will be added to the chain.
Exit conditions define when a running flow should be stopped.
They are evaluated continuously during execution.
Supported exit rules include:
Contact has specific tags.
Contact does not have specific tags.
Contact field conditions.
When exit conditions are met, the flow execution for that contact is terminated immediately.
Chains support time-based execution limits, including:
Allowed days of the week.
Allowed time range (hours).
If execution falls outside the allowed time window, delivery is postponed until conditions are met.
Each chain consists of multiple Steps, where each step represents a single email.
Steps are managed through a horizontal timeline and support drag & drop reordering.
Each step has its own independent logic, evaluated at execution time:
Required tags (at least one).
Forbidden tags (at least one).
Custom conditions inherited from contact data.
If step conditions are not met, the system follows the configured fallback behavior.
Steps support delayed execution:
Delay value (numeric).
Delay unit (minutes or hours).
If conditions are not met:
The step can be retried automatically after a defined time interval.
Steps can be configured to loop, allowing repeated execution until conditions change or exit rules are triggered.
This enables recurring logic without duplicating steps.
The ECA module supports event-based automation triggered by recipient interaction.
Available email events:
Email opened.
Email link clicked.
For each event, you can:
Add tags to the contact.
Remove tags from the contact.
These tags can then be used in:
Entry conditions.
Exit conditions.
Step-level conditions.
Other chains and modules.
Chains use a global email template that defines the overall structure and design.
Mandatory elements:
Email Step / Chain Content — dynamically injects step content.
Unsubscribe Element — automatically generates unsubscribe links.
When a template is updated, all linked chain steps are regenerated automatically.
Email content is created using a live, block-based builder:
Drag & drop content blocks.
Real-time preview.
Reusable across steps.
The Posts element allows loading latest posts dynamically:
Posts are fetched at email generation time, not at design time.
Useful for newsletters and blog updates.
Configurable post selection rules.
Email delivery is handled via a queue-based system:
All executions are processed incrementally.
Conditions are re-evaluated at send time.
Ensures predictable timing and stable performance.
The system relies on WP_CRON, which is not a real system cron.
For production environments, a real server cron triggering WordPress every minute is strongly recommended.
Displays all active and completed executions for each chain.
Provides detailed execution logs, including:
Step execution results.
Condition evaluations.
Errors and retries.
Aggregated execution data for performance analysis.
Tracks recipient interactions:
Opens.
Link clicks.
Each event is linked to a contact and stored for further automation logic.
The Email Campaigns & Automations module provides a deterministic and transparent email automation system built entirely inside WordPress.
With clear separation between chains, steps, conditions, and events, it enables precise control over email delivery without reliance on external services.
Combined with the Contacts module, ECA allows building complex, data-driven email automations while maintaining full ownership of data, logic, and infrastructure.