承接 michael-orenda/notification 相关项目开发

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

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

michael-orenda/notification

Composer 安装命令:

composer require michael-orenda/notification

包简介

Enterprise-grade notification package providing email, SMS, in-app, push, and webhook channels with hybrid Blade/DB templates and Logging integration.

README 文档

README

A production-grade, auditable, queue-safe notification system for Laravel.

This package is designed for reliability, traceability, and clarity, not magic. If you forget how it works in 6 months — read this file and you’ll be productive again.

Table of Contents

  1. Overview & Philosophy
  2. Architecture & Mental Model
  3. Supported Channels
  4. Template System (DB → Blade → Inline)
  5. Standard Template Keys
  6. Installation
  7. Configuration
  8. Usage Examples
  9. Queueing & Retry Behavior
  10. Logging & Auditing
  11. Seeders & Default Templates
  12. Blade Templates (Fallbacks)
  13. What This Package Does NOT Do
  14. Production Checklist

1. Overview & Philosophy

This package treats notifications as delivery intents, not just messages.

  • Delivery is observable
  • Failures are audited
  • Retries are intentional
  • Templates are versioned
  • Channels are isolated

This is suitable for:

  • Financial systems
  • Security alerts
  • Compliance-heavy domains
  • Multi-channel delivery (Email, SMS, Slack, In-App)

2. Architecture & Mental Model

Core Components

  • Notifier → Orchestrates delivery (sync vs queue)
  • SendNotificationJob → Async execution + retries
  • Channels → Email, SMS, Slack, In-App
  • NotificationTemplate → Versioned content (DB)
  • Blade Templates → File-based fallback
  • NotificationLogger → Single source of audit truth

Template Resolution Order

  1. Database template
  2. Published Blade template (host app)
  3. Package Blade template
  4. Inline body (last resort)

3. Supported Channels

Channel Purpose
Email Rich HTML, long-form
SMS Short, urgent alerts
In-App UI notifications
Slack Ops / Dev alerts

4. Template System

Templates are channel-specific and versioned.

Database columns:

  • key
  • channel
  • subject (nullable)
  • body
  • version

Never edit templates in-place. Increment the version instead.

5. Standard Template Keys

System

  • system.critical
  • system.warning
  • system.info

Authentication

  • auth.otp
  • auth.login_alert
  • auth.password_reset

User Lifecycle

  • user.welcome
  • user.profile_updated
  • user.deactivated

Security

  • security.suspicious_login
  • security.password_changed

Business (Generic)

  • transaction.success
  • transaction.failed
  • document.ready

6. Installation

composer require michael-orenda/notification

Publish config (optional):

php artisan vendor:publish --tag=notification-config

7. Configuration

Queueing

'queue' => env('NOTIFICATION_QUEUE', false),
'queue_name' => 'notifications',

Retry & Backoff

'retry' => [
    'count' => 5,
    'backoff' => [1, 3, 5, 10, 20],
],

Per-channel overrides

'sms' => [
    'retries' => 6,
    'backoff' => [1, 3, 5, 10, 20],
],

8. Usage Examples

Basic Send

use MichaelOrenda\Notification\Services\Notifier;

$notifier->send(
    $user,
    'system.critical',
    [
        'content' => 'Disk usage exceeded 95%',
        'server' => 'prod-01',
    ],
    ['email', 'sms']
);

Inline Body (no template)

$notifier->send($user, [
    'body' => 'Simple text message',
], [], ['sms']);

9. Queueing & Retry Behavior

When NOTIFICATION_QUEUE=true:

  • Notifications are dispatched to a queue
  • Retries are attempt-based
  • Exponential backoff is applied
  • Highest-risk channel controls retry behavior

Run worker:

php artisan queue:work --queue=notifications

10. Logging & Auditing

All delivery attempts are stored in:

notification_deliveries

Each record includes:

  • channel
  • provider
  • destination
  • template key + version
  • status (sent, failed)
  • error (if any)

This table is your audit trail.

11. Seeders & Default Templates

A default seeder is provided:

MichaelOrenda\Notification\Database\Seeders\NotificationTemplateSeeder

Run:

php artisan db:seed --class="MichaelOrenda\\Notification\\Database\\Seeders\\NotificationTemplateSeeder"

This seeds:

  • Email templates
  • SMS templates
  • In-App templates
  • Slack templates

12. Blade Templates (Fallback)

Package fallbacks live in:

resources/views/emails/
resources/views/sms/
resources/views/slack/

Host apps may override by publishing views.

13. What This Package Does NOT Do

Intentionally excluded:

  • ❌ UI rendering
  • ❌ User preference screens
  • ❌ Cron-based scheduling
  • ❌ Marketing campaigns

Those belong in higher-level packages.

14. Production Checklist

Before shipping:

  • Enable queue mode
  • Configure retries & backoff
  • Seed templates
  • Start queue workers
  • Monitor notification_deliveries

Final Note

This package favors correctness over convenience.

If something fails:

  • You will know
  • You will have logs
  • You will not lose notifications

Ship with confidence.

michael-orenda/notification 适用场景与选型建议

michael-orenda/notification 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「logging」 「package」 「email」 「sms」 「alerts」 「notification」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 michael-orenda/notification 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 michael-orenda/notification 我们能提供哪些服务?
定制开发 / 二次开发

基于 michael-orenda/notification 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-13