Developer & API

Pulse is a reader of the suite’s activity stream and a set of engines over it. This page is the orientation; the precise contracts (the event taxonomy, hook signatures, REST schemas) ship with the plugin source and Gather Grove core’s docs, and are kept current there.

Conventions

  • Hook prefix: gather_grove/pulse/ (slash-style).
  • REST namespace: /wp-json/gather-grove/pulse/v1/.
  • PHP namespace: GatherGrovePulse. Text domain / CSS prefix: gather-grove-pulse / .gg-pulse-.
  • Tables: {$wpdb->prefix}gg_pulse_*. Member lifecycle fields are user meta, read through MemberMemberReader; there is no members table of Pulse’s own.
  • Capability: gg_manage_pulse (AdminModule::CAPABILITY) for every screen and every REST route. Capabilities grants it to administrator, gg_admin and gg_manager; never manage_options.
  • Core floor: Gather Grove core 0.43.0, checked at boot and before every send.

The activity stream

Every suite plugin emits do_action( 'gather_grove/activity', $event ). Pulse subscribes at priority 50 (TimelineTimelineIngestor), normalises the payload, and stores it in its timeline with a de-duplication key — the same path the Booking backfill writes through. If you emit your own events on that hook with the canonical shape (a kind such as session.attended, a member id, an occurred_at in UTC, optional context), Pulse will record them, show them on the member record, and make them available as segment conditions, automation triggers and sequence anchors. Kinds Pulse has no label for are shown by their raw name. The taxonomy is documented in core’s activity-events.md.

Pulse deliberately does not emit other plugins’ kinds — adding a member by hand, for instance, does not fire member.created, because that is Booking’s to emit.

What Pulse emits

Since 0.60.0 Pulse puts email engagement on the same stream (SendEngagementEmitter, listening on its own gather_grove/pulse/send_event_recorded action): pulse.email_opened, pulse.email_clicked, pulse.email_bounced, pulse.email_unsubscribed and pulse.email_complained. The subject is { type: 'send', id: <send_log_id> }; the context carries source_kind, source_id and subject_line, plus link on a click, bounce_type and permanent on a bounce, scope on an unsubscribe. A delivery is deliberately not emitted. Every kind except a click carries context.passive = true, the convention core 0.61.0 introduced: core’s ActivityLastActivity does not advance a member’s recency for a passive event, and gather_grove/activity/stamps_recency overrides either way. Register your own passive kinds the same way; a mail client fetching a pixel is not a sign of life.

Since 0.63.0 Pulse also emits pulse.tag_applied (TagsTagEmitter, listening on its own gather_grove/pulse/tag_applied action) when a tag is newly applied — never on a re-apply. The subject is { type: 'tag', id: <tag_id> }; the context is { tag_slug, tag_name, applied_via, applied_by, chain }, plus passive: true unless applied_via is form. applied_via is one of form, manual, automation, sequence, api. It is not emitted for import, nor for any tag applied inside TagRepository::in_bulk() — the paste/CSV/WP-CLI importer and the Members screen’s bulk tag. chain lists the automation ids whose run made the change; the runner refuses an automation already in it, or a chain five long, and records the refusal in the run history.

Unsubscribes are attributed through the link itself. Pulse passes <source_kind>:<source_id> as the fourth argument to core’s MarketingFooter::render() and headers(), which core 0.61.0 carries on the link as gg_unsub_from — outside the signature, so an old link still works and an edited hint can at most misattribute a member’s own opt-out to an email they were actually sent (SendUnsubscribePage checks the send log). TransportReporting is the one place that decides whether the active rail can report engagement; every surface that shows a number asks it first.

Hooks Pulse exposes

  • gather_grove/pulse/tag_applied (action) — $member_id, $tag, $applied_via, $applied_by, $bulk, after a tag is newly applied (fires for bulk applies too, with $bulk = true).
  • gather_grove/pulse/member_added (action) — $member_id, $created, $tag_ids, $source, after a manual add.
  • gather_grove/pulse/transports (filter) — register a sending transport alongside wp_mail, Postmark, SES and Brevo.
  • gather_grove/pulse/wp_mail_limits (filter) — ['per_broadcast' => 500, 'per_30_days' => 2000] for the built-in rail.
  • gather_grove/pulse/automation_actions (filter) — add an action kind to the automation engine.
  • gather_grove/pulse/sequence_anchors (filter) — add an anchor a sequence can count from.
  • gather_grove/pulse/segment_condition_compilers (filter) — add a condition type to the segment query.
  • gather_grove/pulse/member_universe_sql (filter) — $expression, $alias: the SQL boolean expression defining who counts as a member, and the users-table alias in scope.
  • gather_grove/pulse/member_summary_changed (action) — $member_id, $summary, $reason, when a member’s Pulse state changes (MemberSummarySignal). gather_grove/pulse/member_summary_trailing is the trailing-edge follow-up, scheduled through Action Scheduler after a burst of changes.
  • gather_grove/pulse/email_design/shared_option_is_safe (filter) — whether the email design may be written to core’s shared style option (true with no Booking, or Booking 1.171.0 or newer); exists for tests and patched sites.
  • gather_grove/pulse/signup_confirmed (action) — $member_id, $form_key, after a form signup was confirmed by email and the member added (G20). gather_grove/pulse/signup_confirm_default (filter, default false) makes a signup form that connects itself ask for confirmation; …/signup_confirm_hourly_limit (default 100) caps confirmation emails per hour; …/signup_check_inbox_message is the HTML a form shows instead of its thanks; …/signup_confirmed_redirect ('', $member_id) sends someone who just confirmed to a page on your site instead of the plain one.
  • gather_grove/pulse/timeline_retention_days (filter) — default 400; a value below 90 is raised to 90.
  • gather_grove/pulse/promotion_submitted (action) — $promotion, $revision, when a promotion waits for approval; …/promotion_approved ($promotion, $approver_id), …/promotion_rejected ($promotion, $approver_id, $note) and …/promotion_launched ($promotion) follow it (0.71.0).

Core’s Promotable seam (GatherGroveCorePromotable, core 0.67.0, bundle-handshakes.md §2.17). Since 0.71.0 Pulse is the promoter: it announces itself with PromotableRegistry::set_promoter( 'pulse' ) on init, answers can_promote (gg_manage_pulse), promote_url, promotion and promotions, and reads everything about an item — facts, occurrences, registrations, audiences, discount codes — from the owner that registered its type (Booking’s booking.class). Approving a promotion needs the capability gg_approve_promotions (administrator, gg_admin, gg_studio_director). Promotion emails carry the step key promotion:{id}:{play}:{email}.

Unknown actions, anchors and conditions are refused at run time rather than skipped, and the builders only offer what these registries contain — so extend the registry and the UI follows.

Core’s message registry (GatherGroveCoreMessagesMessageRegistry, core 0.66.0, bundle-handshakes.md §2.16). Since 0.70.0 Pulse covers booking.no_show_followup, booking.first_class_followup and booking.inactivity_winback while the matching starter automations (and sequences) are active; answers gather_grove/messages/marketing_allowed from the weekly limit (a person who is not a member is always allowed; context.user_id wins over the address); records every gather_grove/messages/marketing_sent as a send_log row with source_kind = external and the message key in step_key; and reads gather_grove/messages/upcoming ($rows, $from_ts, $to_ts → {key, label, plugin, due: 'Y-m-d' site-local, count, manage_url}) for the This week tab. A covering send whose key has been handed back is refused with reason handed_back. The weekly limit lives in the option gg_pulse_frequency (enabled, per_week, max_delay_days); a held email is a send_log row with status deferred and reason frequency_cap, a skipped one suppressed / frequency_cap.

Pulse also filters core’s gather_grove/email/marketing_footer to add the optional phone line beside the postal address, and listens on Forms’ gather_grove/forms/entry_created (priority 20) for the form-intake rules — that hook fires for every completed submission, member or not, which is why intake is not an automation on forms.entry_created. Before adding anyone it asks Forms’ gather_grove/forms/entry_lookup, which never answers for a spam-flagged entry, and it answers Forms’ gather_grove/forms/activity_member_id with the member it found or created, so an anonymous submission’s forms.entry_created lands on that member’s timeline. The form list and each form’s fields come from Forms’ public GatherGroveFormsQueryForms::query() and ::find(), and so do the form names in trigger filters and timeline rows (by the summary’s id, Forms 1.35.0+; an older Forms is read from its table as before); the member record’s Forms panel reads GatherGroveFormsQuerySubmissions::for_member() (Forms 1.25.0+) and is left off when that method is missing; a form whose settings carry is_signup (the Newsletter signup starter) connects itself on its first submission, matched by its fields’ contact_role. A rule with confirm on holds a ticked signup in gg_pulse_signup_confirmations (only a sha256 of the link’s token is stored) and answers Forms 1.36.0’s gather_grove/forms/confirmation_message ($message, $form, $entry_uuid) for that entry with “check your inbox”, decided before the spam check so a bot sees the same thing. The link is /?gg_pulse_confirm=<token>: a GET shows a button, only the POST confirms. The confirmation email is logged in the send log as source_kind = signup_confirm, source_id = the row, without the address.

REST

All routes live under gather-grove/pulse/v1. Reads require the capability; writes require the capability and the X-WP-Nonce flow. Every route has a real permission callback. Each /{id} route below also takes DELETE; a broadcast can only be deleted while a draft, and an email only while nothing uses it.

  • /segments, /segments/{id}, /segments/preview (POST — count and sample names for a condition tree).
  • /automations, /automations/{id}, /automations/{id}/status.
  • /sequences, /sequences/{id}, /sequences/{id}/active.
  • /pipelines, /pipelines/{id}, /pipelines/{id}/active.
  • /emails, /emails/{id}, /emails/{id}/preview, /emails/{id}/test.
  • /broadcasts, /broadcasts/{id}, /broadcasts/{id}/preview, /broadcasts/{id}/test, /broadcasts/{id}/schedule, /broadcasts/progress (GET — counts for every broadcast in flight; drafts and cancelled ones are omitted).
  • /messages/{key} (GET — the row, wording, history and drawer; POST — save {fields, revision}, 409 gg_message_conflict with both versions), and /messages/{key}/reset, /enabled, /preview, /test, /sender (POST). Every route needs gg_manage_pulse AND the owning plugin’s capability from its ManageableMessages::describe(); every write goes through the owner (core’s bundle-handshakes §2.18) — Pulse stores no wording (0.74.0).
  • /promotions/audience and /promotions/plan (POST — counts, footer, plan and timeline for an unsaved promotion; nothing is saved), /promotions/items?type&q and /promotions/occurrences?type&id (GET — the pickers).
  • /webhook/{provider} (POST, token-authenticated, no nonce) — the inbound provider webhook. Postmark is the only provider normalised today. Events are matched to a member through the provider’s message id in the send log, never from a member id in the payload.

Background jobs

All scheduling goes through core’s Action Scheduler wrapper, group gg-pulse: backfill_chunk and a daily timeline_prune; automation_run per event and a daily automation_absence_scan; an hourly sequence_pass; a daily pipeline_scan; a broadcast_pass every five minutes (it does nothing while all marketing email is paused); an hourly promotion_pass with a deduped promotion_replan when an item changes and a batched promotion_enroll for large launches; a daily message_ledger_prune that removes message-ledger rows older than 400 days, 1,000 at a time (0.74.0); and a one-off frequency_retry a day after the weekly limit holds an automation email, carrying {automation_id, action_index, member_id, run_id, first_due, attempt}. Deactivating Pulse cancels them; activating re-arms them.

Email documents

A designed email is a versioned block document — { "version": 1, "blocks": [ { "id", "type", "data" } ] } — with the same shape Courses uses for lesson content. Block types: studio_header, heading, paragraph, image, video, columns, button, divider, spacer; up to 60 blocks. An unknown block type is refused on save. A legacy plain-HTML body is read as a single block. Content is wrapped in core’s email layout at send time, so <style> blocks and mso-* properties do not survive.

WP-CLI

wp gg-pulse import <file> --tags=<slugs> --source="…" [--consent] [--create-tags] [--dry-run] [--format=<format>] imports a CSV through the same reader and consent rule as the admin upload, with no row limit. --tags and --source are required; --consent records a granted marketing decision and its absence a withdrawn one.

Merging members: the footprint contract

Since G7 (Unreleased) an operator can fold a duplicate account into a keeper (MemberMergeMemberMerge). Pulse moves only its own rows (MemberMergePulseRecords::TABLES), core consent (a withdrawal or channel stop on the duplicate is written to the keeper with source member_merge; grants are not copied) and the WordPress identity, then calls wp_delete_user( $duplicate, $keeper ). It never moves another plugin’s data. Before anything is written it asks:

  • gather_grove/member/merge_blockers (filter) — ( array $blockers, int $duplicate_id, int $keeper_id ). Append one entry per reason the duplicate cannot be merged away: [ 'plugin' => 'gather-grove-booking', 'code' => 'has_bookings', 'message' => __( '…' ), 'reverse' => false ]. message is a translated sentence a studio can act on; reverse is true when merging the other way round would work. Answer from your own services; never move anything.
  • gather_grove/member/merge_responders (filter) — ( array $slugs ). Add your plugin slug when you answer the first filter.

It fails closed: an active Booking, Courses or Communities that has not declared itself a responder refuses every merge (“Update Courses to merge members”). Forms is asked directly through QuerySubmissions::for_member( $user_id, '' ) (entries tied to the account, not to an address). The audit lives in user meta _gg_pulse_merged_in (one entry per merge); the lock is the option gg_pulse_member_merge_lock.

Reading Pulse data from another plugin

Booking exposes PublicApiHistory (the backfill source) and PublicApiHousehold (the Household panel); Pulse reads both through those facades and never touches gg_booking_* tables directly. Pulse does not yet publish a read facade of its own — query its tables at your own risk, or ask.

Personal data

MemberPersonalData registers a WordPress personal-data exporter and eraser (Tools → Export / Erase Personal Data) covering every table keyed on a member: messages, engagement, activity (paged), tags, sequences, pipeline stages, automation runs, the touch sources, the accounts merged into this one, and signup confirmations (rows waiting, by email address, and the member’s _gg_pulse_signup_confirmed audit). Each repository’s forget_member() is what the eraser calls. Consent is never erased — it lives in core and is shared with every channel.


Applies to Gather Grove Pulse v0.85.0. Last synced October 15, 2026.