承接 imagina/inotification-module 相关项目开发

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

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

imagina/inotification-module

最新稳定版本:1.0.0

Composer 安装命令:

composer require imagina/inotification-module

包简介

Imagina inotification laravel module

README 文档

README

SEED MODULE (Providers)

php artisan module:seed Inotification

Implements notifications in Modules

In Module Entity Events

  1. In the Model->dispatchesEventsWithBindings add the [path] and [extraData] attributes in the event. Example: Send a notification after the model is updated:
 public $dispatchesEventsWithBindings = [
        //eg. ['path' => 'path/module/event', 'extraData' => [/*...optional*/]]
        'created' => [],
        'creating' => [],
        'updated' => [[
            'path' => 'Modules\Inotification\Events\SendNotification',
            'extraData' => ['event' => 'updated']
        ]],
        'updating' => [],
        'deleting' => [],
        'deleted' => []
    ];
  1. In the model, add the method getNotificableParams(), and inside that attributes that you need to change. Example:
/**
* Notification Params
*/
public function getNotificableParams()
{
    //Process to get Email (Example: From entity, or settings, etc)
    $email = 'emailto@example.com';

    return [
        'created' => [
            "email" => $email,
            "title" =>  itrans("iuser::users.email.created.title"),
            "message" => itrans("iuser::users.email.created.messages")
        ],
        'updated' => [
            "email" => $email,
            "title" => itrans("iuser::users.email.updated.title"),
            "message" => itrans("iuser::users.email.updated.messages")
        ],
        'deleted' => [
            "email" => $email,
            "title" => itrans("iuser::users.email.deleted.title"),
            "message" => itrans("iuser::users.email.deleted.messages")
        ],
    ];
}

Call directly

  • You can directly use the service to send a notification. Example:
use Modules\Inotification\Services\NotificationDispatcherService;

$data = [
    'title' => itrans("inotification::notification.email.default.title"),
    'message' => itrans("inotification::notification.email.default.message"),
    'email' => 'emailto@example.com'
];

 app(NotificationDispatcherService::class)->execute($data);

View Default Layout

You can view the email design (default) by accessing this path:

http://exampleurl.com/inotification/v1/preview-email

If in addition to displaying it, you also need it to be sent, you can add the email attribute:

http://exampleurl.com/inotification/v1/preview-email?email=example@email.com

You can also use a module's config to load a specific view with its data.

http://exampleurl.com/inotification/v1/preview-email?config=imodule.entityTestEmail

Important: Only works for the LOCAL environment

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-08-29