承接 import-ai/flarum-webhook-notification 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

import-ai/flarum-webhook-notification

最新稳定版本:v0.1.5

Composer 安装命令:

composer require import-ai/flarum-webhook-notification

包简介

Webhook notification channel for Flarum - sends notifications via HTTP webhooks

README 文档

README

This file provides guidance to developers when working with code in this repository.

Overview

This is a Flarum extension that adds a webhook notification channel. When notifications are triggered in Flarum, this extension sends them to a configured HTTP endpoint.

Development Commands

Frontend (JavaScript)

cd js
npm install          # Install dependencies
npm run dev          # Watch mode for development
npm run build        # Production build

Architecture

Backend (PHP)

  • extend.php - Registers the notification driver, admin frontend, locales, and settings defaults
  • src/Driver/WebhookNotificationDriver.php - Implements NotificationDriverInterface, passthrough all notifications to webhook without filtering
  • src/Job/SendWebhookNotificationJob.php - Queue job that sends HTTP POST to webhook URL

Frontend (JavaScript)

  • js/src/admin/index.js - Admin settings page for configuring webhook URL, token, timeout, channel icon, and channel label
  • js/src/forum/index.js - User notification preferences for enabling/disabling webhook per notification type

Settings Keys

  • import-ai-webhook-notification.webhook_url - Target webhook endpoint
  • import-ai-webhook-notification.webhook_token - Bearer token for Authorization header
  • import-ai-webhook-notification.timeout - Request timeout in seconds (default: 30)
  • import-ai-webhook-notification.channel_icon - Icon class for the notification channel (default: fas fa-globe)
  • import-ai-webhook-notification.channel_label - Label for the notification channel (default: Webhook)

Webhook Payload Structure

Passthrough mode sends all notification data without filtering. Model objects are converted to arrays via toArray(). Only users who have enabled webhook notifications for the specific notification type are included in the payload.

{
  "event": "notification",
  "timestamp": "<ISO8601>",
  "type": "<notification_type>",
  "subject_model": "<class_name>",
  "from_user": { "id": 1, "username": "...", "display_name": "...", "email": "..." },
  "subject": { "id": 1, "discussion_id": 2, "user_id": 1, "...": "..." },
  "data": {},
  "recipients": [
    {
      "id": 1,
      "username": "...",
      "display_name": "...",
      "email": "...",
      "locale": "en"
    }
  ]
}

Payload Fields

Field Description
event Always "notification"
timestamp ISO8601 timestamp of when the notification was triggered
type Notification type (e.g., newPost, postMentioned)
subject_model Class name of the subject (e.g., Flarum\Post\Post)
from_user User who triggered the notification
subject The notification subject (post/discussion object)
data Additional data from the blueprint (e.g., postNumber)
recipients Array of users who should receive this notification

Per-User Locale

Each user object in the recipients array includes:

  • locale: The user's preferred locale (e.g., en, zh-Hans)

If a user's locale preference is not set, the forum's default locale is used.

User Notification Preferences

The extension registers a notification preference for each notification type, allowing users to individually enable or disable webhook notifications. By default, webhook notifications are enabled for all notification types. Users can configure these preferences in their account settings.

Git Commit Guidelines

Format: type(scope): Description

Types:

  • feat - New features
  • fix - Bug fixes
  • docs - Documentation changes
  • style - Styling changes
  • refactor - Code refactoring
  • perf - Performance improvements
  • test - Test additions or changes
  • chore - Maintenance tasks
  • revert - Revert previous commits
  • build - Build system changes

Rules:

  • Scope is required (e.g., sidebar, tasks, auth)
  • Description in sentence case with capital first letter
  • Use present tense action verbs (Add, Fix, Support, Update, Replace, Optimize)
  • No period at the end
  • Keep it concise and focused

Examples:

feat(apple): Support apple signin
fix(sidebar): Change the abnormal scrolling
chore(children): Optimize children api
refactor(tasks): Add timeout status

Do NOT include:

  • "Generated with Claude Code" or similar attribution
  • "Co-Authored-By: Claude" or any Claude co-author tags

统计信息

  • 总下载量: 37
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固