keepsuit/laravel-zoho-campaigns 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

keepsuit/laravel-zoho-campaigns

Composer 安装命令:

composer require keepsuit/laravel-zoho-campaigns

包简介

Manage Zoho Campaigns from Laravel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides an easy way to interact with the Zoho Campaigns API.

Right now only the following features are supported:

  • Subscribe a contact to a list
  • Unsubscribe a contact from a list
  • Get subscribers from a list
  • Get subscribers count of a list

Installation

You can install the package via composer:

composer require keepsuit/laravel-zoho-campaigns

You can publish and run the migrations with:

php artisan vendor:publish --tag="campaigns-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="campaigns-config"

This is the contents of the published config file:

return [
    /**
     * The driver to use to interact with Zoho Campaigns API.
     * You may use "log" or "null" to prevent calling the
     * API directly from your environment.
     */
    'driver' => env('CAMPAIGNS_DRIVER', 'api'),

    /**
     * Zoho datacenter region to use.
     * Available regions: us, eu, in, au, jp, cn
     */
    'region' => env('CAMPAIGNS_REGION'),

    /**
     * Zoho api client.
     * Run php artisan campaigns:setup and follow the instructions to generate an api client.
     */
    'client_id' => env('CAMPAIGNS_CLIENT_ID'),
    'client_secret' => env('CAMPAIGNS_CLIENT_SECRET'),

    /**
     * The listName to use when no listName has been specified in a method.
     */
    'defaultListName' => 'subscribers',

    /**
     * Here you can define properties of the lists.
     */
    'lists' => [

        /**
         * This key is used to identify this list. It can be used
         * as the listName parameter provided in the various methods.
         *
         * You can set it to any string you want and you can add
         * as many lists as you want.
         */
        'subscribers' => [

            /**
             * A Zoho campaigns list key.
             * https://www.zoho.com/campaigns/help/developers/list-management.html
             * You can find this value from Zoho campaigns dashboard under:
             * Contacts > Manage Lists > "Your list" > Setup
             */
            'listKey' => env('CAMPAIGNS_LIST_KEY'),

        ],
    ],
];

First time setup:

This should be done also on production because tokens are saved in the database. Run the following command and follow the instructions:

php artisan campaigns:setup

Usage

Subscribe a contact to a list

use Keepsuit\Campaigns\Facades\Campaigns;

Campaigns::subscribe('user_a@example.com');

// with additional details: 
Campaigns::subscribe('user_a@example.com', contactInfo: [
    'First Name' => 'John',
    'Last Name' => 'Doe',
]);

// on a specific list:
Campaigns::subscribe('user_a@example.com', contactInfo: [], list: 'listName');

// on a specific list via list key
Campaigns::subscribe('user_a@example.com', contactInfo: [], list: '3z9d17e6b4f3a2c5d8a1bc9478df32561e3ab4d2c4fc7a5e9c0db8e34176ca92a0');

// if user previously unsubscribed from the list, you can resubscribe them (it support the same parameters as subscribe):
Campaigns::resubscribe('user_a@example.com');

Unsubscribe a contact from a list

use Keepsuit\Campaigns\Facades\Campaigns;

Campaigns::unsubscribe('user_a@example.com');

// from a specific list:
Campaigns::unsubscribe('user_a@example.com', list: 'listName');

// on a specific list via list key
Campaigns::unsubscribe('user_a@example.com', list: '3z9d17e6b4f3a2c5d8a1bc9478df32561e3ab4d2c4fc7a5e9c0db8e34176ca92a0');

Get subscribers from a list

use Keepsuit\Campaigns\Facades\Campaigns;

// This method returns a LazyCollection and will fetch additional pages when needed.
// You can filter by status and sort the results.
Campaigns::subscribers(status: 'active', sort: 'desc');

// from a specific list:
Campaigns::subscribers(list: 'listName');

// on a specific list via list key
Campaigns::subscribers(list: '3z9d17e6b4f3a2c5d8a1bc9478df32561e3ab4d2c4fc7a5e9c0db8e34176ca92a0');

Get subscribers count of a list

use Keepsuit\Campaigns\Facades\Campaigns;

// You can filter by status.
Campaigns::subscribersCount(status: 'active');

// from a specific list:
Campaigns::subscribersCount(list: 'listName');

// on a specific list via list key
Campaigns::subscribersCount(list: '3z9d17e6b4f3a2c5d8a1bc9478df32561e3ab4d2c4fc7a5e9c0db8e34176ca92a0');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

keepsuit/laravel-zoho-campaigns 适用场景与选型建议

keepsuit/laravel-zoho-campaigns 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.28k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 10 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 keepsuit/laravel-zoho-campaigns 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-14