Filters — free edition
gmfuf_email
The message just before it is sent. Return false (or an array with no to) to hold it back; the row stays claimed and is not retried.
| Argument | Type | |
|---|---|---|
$message |
array |
to, subject, body, headers |
$automation |
array |
The follow-up |
$order |
WC_Order or null |
The order |
Filters — Full edition
gmfu_email
The same as gmfuf_email, with the same arguments.
// BCC the shop on every follow-up.
add_filter( 'gmfu_email', function ( $message ) {
if ( is_array( $message ) ) {
$message['headers'][] = 'Bcc: shop@example.com';
}
return $message;
} );
gmfu_trigger_types
The trigger vocabulary the editor lists. Each entry has label, subject (order or customer), needs (status or days) and help. A trigger added here appears in the editor, but only the three built-in triggers are queued by the plugin; queueing a custom one is up to your code.
gmfu_condition_types
The condition vocabulary the editor lists. Each entry has label and value (number or list).
gmfu_evaluate_condition
The verdict on a condition type the plugin does not know. Default false, which holds the message back.
| Argument | Type | |
|---|---|---|
$verdict |
bool |
false |
$condition |
array |
type, value |
$order |
WC_Order or null |
The order |
$email |
string |
The recipient |
$automation |
array |
The automation |
// Condition: only send if the customer accepted marketing at checkout.
add_filter( 'gmfu_condition_types', function ( $types ) {
$types['accepts_marketing'] = array( 'label' => 'Accepted marketing', 'value' => 'number' );
return $types;
} );
add_filter( 'gmfu_evaluate_condition', function ( $verdict, $condition, $order ) {
if ( 'accepts_marketing' !== $condition['type'] ) {
return $verdict;
}
return $order && 'yes' === $order->get_meta( '_my_marketing_optin' );
}, 10, 3 );
gmfu_automations
The automations after they are read and normalised.
gmfu_batch_size
How many due rows one sweep considers; the result is clamped to 1–200.
gmfu_settings
The settings array, merged over the defaults.
Others
| Filter | What it changes |
|---|---|
gmfu_modules |
The module list the plugin boots |
gmfu_license_api_url |
The licence API base |
gmfu_update_cache_ttl |
How long an update answer is cached |
The outbox table: {prefix}gmfu_queue
Shared by both editions; the free edition creates the same table.
| Column | |
|---|---|
id |
Primary key |
automation_id |
The follow-up's id |
subject_type |
order or customer |
subject_id |
The order id, or (win-backs) a CRC32 of the lower-cased address |
email |
The recipient |
send_after |
When it is due, UTC |
created_at |
When it was queued, UTC |
sent_at |
When it was claimed for sending, or NULL |
cancelled_at |
When it was called off, or NULL |
reason |
Why it was called off |
Indexes: UNIQUE reason_once (automation_id, subject_type, subject_id) and KEY due (sent_at, send_after). Schema version: option gmfu_db_version.
// How many follow-ups were called off in the last week.
global $wpdb;
$count = (int) $wpdb->get_var( $wpdb->prepare(
"SELECT COUNT(*) FROM {$wpdb->prefix}gmfu_queue WHERE cancelled_at >= %s",
gmdate( 'Y-m-d H:i:s', time() - WEEK_IN_SECONDS )
) );
Options
| Option | Contents |
|---|---|
gmfu_settings |
enabled, from_name, batch, optout_text |
gmfu_automations |
List of follow-ups: id, name, trigger, status, delay (hours), days, subject, body, conditions, enabled |
gmfu_optouts |
Lower-cased address ⇒ true |
gmfu_license |
Full edition licence state |
Cron events
| Event | Edition | Recurrence |
|---|---|---|
gmfuf_sweep |
free | hourly |
gmfu_sweep |
full | hourly |
gmfu_scan_inactive |
full | daily |
gmfu_license_check |
full | licence checks |
The sweep events are scheduled on init only while at least one follow-up is active, and cleared when none is.
The unsubscribe link
home_url( '/?gmfu_stop=<token>' ), where the token is wp_hash( 'gmfu-optout|' . strtolower( trim( $email ) ) ). It is caught on template_redirect. The token depends on your site's salts: changing them invalidates every unsubscribe link already sent.
