These hooks cover the Notifal AI client module (app/Modules/Ai/) added in Notifal 3.0.0. They apply to hosted generation from Noti chat in the HTML Builder and the OnPage notification wizard.
Hosted AI credentials stay on the WordPress server. Browser scripts never receive gateway credentials. Prefer WordPress filters and actions over replacing core controllers.
Index: Hook Reference Hub.
User-facing connection steps: Connecting Your Notifal AI Account.
Account lifecycle (actions)
| Hook | Parameters | Description |
|---|---|---|
notifal/ai/account_connected | array $publicInstallation | Fired after this site successfully connects to Notifal AI |
notifal/ai/account_disconnected | none | Fired after the local AI connection is cleared |
notifal/ai/site_profile_saved | array $profile | Fired after the site industry / business profile is saved |
Public config and gateway (filters)
| Hook | Parameters | Description |
|---|---|---|
notifal/ai/gateway_base_url | string $url | Hosted AI service base URL (advanced environments only) |
notifal/ai/disclosure_version | string $version | Disclosure text version shown during account connection |
notifal/ai/public_config | array $config | Safe admin JavaScript config (window.NotifalAi) for connection UI state |
notifal/ai/readiness_cache_ttl | int $ttl | Cache lifetime in seconds for hosted generation readiness |
notifal/ai/industry_options | array $options | Selectable industry cards for hosted wizards (slug, label, icon) |
notifal/ai/gateway_request_args | array $args, string $url, string $route | Outbound HTTP args for hosted AI requests |
notifal/ai/services | array $services | DI container service map for the AI module (ServiceProvider) |
Safe public config keys (3.0.0+)
| Key | Description |
|---|---|
connection.connected | Whether this site is linked to Notifal AI |
skip_connect_step | When true, hosted UI omits the Connect step |
license.active | Whether Notifal Pro is active on this site |
license.auto_connect | When true, Pro may link the site automatically from the active license |
Do not put secrets, tokens, or private option names into notifal/ai/public_config.
Generation pipeline (filters)
| Hook | Parameters | Description |
|---|---|---|
notifal/ai/generation_request_body | array $body, string $feature, array $intent | Adjust the outbound generation request before it is sent |
notifal/ai/generation_capabilities | array $capabilities | Feature flags and limits returned to admin UI |
notifal/ai/generation_active_plugins | string[] $active_plugins | Active plugin display names included for shortcode guidance |
notifal/ai/generated_html_sanitized | string $content, array $warnings | Final HTML after server-side sanitization |
notifal/ai/feedback_categories | string[] $categories | Allowlisted feedback category slugs for needs-improvement details |
Supported $feature values (3.0.0)
| Feature | Used by |
|---|---|
html_template | HTML Builder Noti chat (create or edit the current canvas) |
onpage_notification | OnPage list wizard (disabled draft import) |
form | Standalone Form CPT create/edit |
Legacy html_template_edit maps to html_template and should not be used in new code.
OnPage prompt config (filters)
These filters shape layout, use case, and example data for the OnPage Generate with AI wizard:
| Hook | Parameters | Description |
|---|---|---|
notifal/onpage/ai_prompt/config | array $config | Layout, use case, and example data for the OnPage AI wizard JavaScript |
notifal/onpage/ai_prompt/export_sample | array $sample | Sample export shape used by generation and import validation |
See also Hooks: Notifications and Eligibility.
HTML Builder prompt (filters)
| Hook | Parameters | Description |
|---|---|---|
notifal/template/html_builder/ai_prompt_examples | array $examples | Curated example patterns for Noti and OnPage briefs |
notifal/template/html_builder/widgets | array $widgets | Widget palette and AI snippet structures (see cookbook) |
notifal/template/html_builder/runtime_config | array $config | Extra runtime config merged into the HTML Builder admin boot payload |
See Hooks: Templates and Rendering and Cookbook: Register a Custom HTML Builder Widget.
Conventions
| Topic | Detail |
|---|---|
| Boot timing | AI services register through the Ai module ServiceProvider during normal Notifal boot |
| Extending generation | Prefer notifal/ai/generation_request_body over replacing core controllers |
| Sanitization | Always run custom HTML through existing sanitizers; use notifal/ai/generated_html_sanitized for post-processing only |
| Security | Keep hosted AI credentials on the server. Never expose them to browser scripts |
What to read next
Hooks series
- Hook Reference Hub
- Hooks: Lifecycle and Bootstrap
- Hooks: Notifications and Eligibility
- Hooks: Templates and Rendering
- Hooks: Tags and Dynamic Data
- Hooks: Display Rules and Content Source
- Hooks: Analytics and Tracking
- Hooks: Admin UI Extension
- Hooks: Pro Integration Bridge
- Hooks: Hosted Notifal AI (you are here)
- Hooks: Forms