定制 yevheniigrabar/user-registration-notifier 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

yevheniigrabar/user-registration-notifier

最新稳定版本:1.0

Composer 安装命令:

composer require yevheniigrabar/user-registration-notifier

包简介

A Composer package for sending welcome emails upon user registration in Laravel

README 文档

README

User Registration Notifier is a Composer package for sending welcome emails upon user registration in a Laravel application.

Installation

You can install this package via Composer. Run the following command in your terminal:

composer require yevheniigrabar/user-registration-notifier

Setup

Register the Event Listener After installing the package, you need to register the UserRegistered event listener in your Laravel application. Open the EventServiceProvider.php file located in the app/Providers directory of your Laravel project and add the following code to the $listen array:

// app/Providers/EventServiceProvider.php

protected $listen = [
    \App\Events\UserRegistered::class => [
        \Yevheniigrabar\UserRegistrationNotifier\Listener::class,
    ],
];

Ensure UserRegistered Event

Make sure you have the UserRegistered event set up in your Laravel application. If not, you'll need to create it. Here's an example of how you can define the event:

// app/Events/UserRegistered.php

namespace App\Events;

use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use App\Models\User;

class UserRegistered
{
    use Dispatchable, SerializesModels;

    public $user;

    public function __construct(User $user)
    {
        $this->user = $user;
    }
}

Ensure Email Templates

Ensure you have email templates set up for sending the welcome email. You can create your email template or use Laravel's default notification system.

Usage

Once you have registered the event listener and ensured the UserRegistered event, your package is set up to send welcome emails upon user registration automatically.

License

User Registration Notifier is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-19