Engagement (E6)
The Engagement engine is the absorbed feature set from the engagement absorption, now bundled as modules/engage/ and loaded automatically. It runs alongside the slim lifecycle/gamification glue that was already in OMembership.
Lifecycle automations
OMembership_Lifecycle::tick() runs hourly via omembership/lifecycle/run and dispatches typed events that OMailer subscribes to (other email plugins can hook too). Four campaigns fire idempotently:
| Campaign | Windows | Event dispatched |
|---|---|---|
| Welcome | On omem/membership/created | omem/lifecycle/welcome |
| Onboarding nudge | 1, 3, 7 days post-start, if no lesson completed | omem/lifecycle/onboarding_nudge |
| Renewal reminder | 30, 7, 1 days before current_period_ends_at | omem/lifecycle/renewal_reminder |
| Re-engagement | 14, 30, 60 days idle | omem/lifecycle/reengagement |
| Win-back | 7, 30, 90 days post-cancel/expire | omem/lifecycle/winback |
Markers in wp_omem_events prevent double-sends.
XP and levels
XP totals live in wp_omem_xp (user_id, total_xp, level). omembership_award_xp() and the XP engine listen for built-in actions:
register,login,post_comment,create_postfill_profile,follow_user,enable_2fawoo_purchase,ld_lesson_complete,ld_course_completetutor_course_complete,email_opened
XP forwarding to OLoyalty is gated by engagement.badges_enabled and forwards omem/lesson/completed, omem/course/completed, and omem/reply/created through oloyalty/award_points.
Badges
Five badges are seeded on activation, stored in wp_omem_badges:
welcome- join the communityfirst-lesson- complete your first lessonfirst-course- complete your first courseconversation- post your first replyhelping-hand- post 10 helpful replies
Badge awards land in wp_omem_user_badges (UNIQUE on user_id, badge_id).
Streaks
Daily-login streaks are recorded by StreakEngine::record_login() (called by the auth handler). User meta keys: omem_login_streak, omem_longest_streak, omem_last_login_date. The streak hook omembership_streak_updated fires for downstream integrations.
Leaderboard
OMembership_Gamification::leaderboard() returns a reply-count leaderboard from wp_omem_replies when engagement.leaderboard_enabled is true. The richer XP / level / badges leaderboard sits in the engagement module's Leaderboard::render() and is exposed via the [omembership_leaderboard] shortcode.
Capabilities
omem_manage_engagement- settings, lifecycle togglesomem_manage_badges- badge CRUD, manual awards

