定制 dotunj/lara-mailchimp 二次开发

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

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

dotunj/lara-mailchimp

Composer 安装命令:

composer require dotunj/lara-mailchimp

包简介

This package automatically subscribes registered users to a mailchimp list

README 文档

README

This package automatically subscribes registered users in a Laravel application to a mailchimp list.

Software License Build Status StyleCI

Installation

To install via composer, run the following command:

composer require dotunj/lara-mailchimp

If you are on Laravel 5.4 or below, register the Dotunj\LaraMailChimp\LaraMailChimpServiceProvider service provider in the config/app.php file.

<?php

return [

  'providers' => [
        
        /*
         * Package Service Providers...
         */
         Dotunj\LaraMailChimp\LaraMailChimpServiceProvider::class,
         
   ]
]

From Laravel 5.5 and above, the service provider will automatically be registered by Laravel

Configuration

To publish the config file, run:

php artisan vendor:publish --provider="Dotunj\LaraMailChimp\LaraMailChimpServiceProvider"

This will publish a lara-mailchimp.php file to the config directory with the following content:

<?php

return [
    'api_key' => env('MAILCHIMP_API_KEY'),
    'list_id' => env('MAILCHIMP_LIST_ID'),
];

Next, edit your .env file with your mailchimp details:

MAILCHIMP_API_KEY=xxxx
MAILCHIMP_LIST_ID=xxxx

Usage

To subscribe a user's email on registration to your mailchimp list, import the Dotunj\LaraMailChimp\Events\UserRegistered event at the top of the User model. Next, define a $dispatchesEvent property on the User model that maps the created lifecylce hook to the UserRegistered event.

<?php

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Dotunj\LaraMailChimp\Events\UserRegistered;

class User extends Authenticatable
{
    use Notifiable;
    
    protected $dispatchesEvents = [
        'created' => UserRegistered::class
    ];
 
}

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-05-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固