承接 epicsweb/php-ci-messages 相关项目开发

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

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

epicsweb/php-ci-messages

Composer 安装命令:

composer require epicsweb/php-ci-messages

包简介

README 文档

README

This library prepares the data and send it to an API for sending emails, sms and other for Code Igniter and Laravel

Installation

Use the composer to install this library

composer require epicsweb/php-ci-messages

Configuration

CodeIgniter

Create or edit a file in your code igniter application folder and set this vars: /application/config/epicsweb.php

<?php if( !defined('BASEPATH')) exit('No direct script access allowed');

$config['pm_url']   = 'YOUR_BASE_URL_API';
$config['pm_user']  = 'YOUR_PWD_USERS';
$config['pm_pass']  = 'YOUR_PWD_PASSWORD';

Laravel

Set in your .env file

PM_URL=YOUR_BASE_URL_API;
PM_USER=YOUR_PWD_USERS;
PM_PASS=YOUR_PWD_PASSWORD;

Usage

CodeIgniter

Change file /application/config/config.php:

$config['composer_autoload'] = FALSE;
↓
$config['composer_autoload'] = realpath(APPPATH . '../vendor/autoload.php');

CodeIgniter & Laravel

Call the "send_mail" function of this library with an array like unique param

$data = [
    'app'       => [
        'enviado_por'   => (string) 'aplicativo',
        'app_id'        => (int) 1,
        'envio_id'      => (int) 1,
        'para_id'       => (int) 1 //CLIENT_ID
    ],
    'header'    => [
        'para'          => (string) 'for@email.com',
        'de_nome'       => (string) 'YOUR NAME',
        'de'            => (string) 'from@yourname.com',
        'reply_to'      => (string) 'no-reply@yourname.com',
        'copia'         => (boolean) 0 //0 OR 1
    ],
    'corpo'     => [
        'assunto'       => (string) 'Email Subject',
        'html'          => (string) 'Email <br/> Content',
        'texto'         => (string) 'Email Content'
    ],
    'tipo'      => [
        'email'
    ]
];

$message = new PhpMessages( 'ci' ); // 'ci' or 'laravel' framework params (default = ci)
$message = $message->send_mail( $data )
New SMS

Call the "send_sms" function of this library with an array like unique param to send a new sms

$sms = [
    'app'       => [
        'enviado_por'   => (string) 'aplicativo',
        'app_id'        => (int) 1,
        'envio_id'      => (int) 1,
        'para_id'       => (int) 1 //CLIENT_ID
    ],
    'header'    => [
        'para'          => '5517911112222'
        'de_nome'       => 'EPICS',
        'de'            => 'epics@epics.com.br',
    ],
    'corpo'     => [
        'assunto'       => (string) 'Message Here',
        'html'          => (string) 'Message Here',
        'texto'         => (string) 'Message Here',
    ],
    'tipo'      => [
        'sms'
    ]
];
$message = new PhpMessages( 'ci' ); // 'ci' or 'laravel' framework params (default = ci)
$message = $message->send_sms( $sms );
Push
Create Push
$data = [
    'user_id'       => 1,
    'title'         => 'New push notification',
    'body'          => 'Description of your push notification', 
    'customData'    => []
];
$this->message->push_create($data);
Tokens - Get All
$data = [
    'user_id'       => 1
];
$this->message->push_tokens($data);
Tokens - Create One
$data = [
    'user_id'       => 1,
    'token'         => 'a1b2c3d4f5',
    'device'        => 'IOS|ANDROID|WEB'
];
$this->message->push_token_create($data);
Tokens - Remove One
$data = [
    'token'         =>  'a1b2c3d4f5'
];
$this->message->push_remove($data);
Mailchimp Manage
Edit

Call the "mailchimp_edit" function of this library with an array like unique param to edit a member in Mailchimp list. Obs: if the member doesn't exist, the function will call mailchimp_create automatically.

$data = [
    'id'                = (string) 'abc123', // id da lista
    'email_address'     = 'user email',
    'email_type'        = 'email type',
    'status'            = 'member status',
    'merge_fields' => [
        'name'          => (string) 'User name',
        'country'       => (string) 'User country',
        'state'         => (string) 'User state',
        'city'          => (string) 'User city',
        'phone'         => (string) 'User phone',
    ]
];
$message = new PhpMessages( 'ci' ); // 'ci' or 'laravel' framework params (default = ci)
$message = $message->mailchimp_edit( $data );
Edit Tags

Call the "mailchimp_tag" function of this library with an array like unique param to edit tags from member in Mailchimp list.

$data = [
    'id'                = 'list id',
    'email_address'     = 'user email',
    'tags' => [
        'name'          => (string) 'Tag Name',
        'status'        => (string) 'Tag Status' //active/inactive
    ]
];
$message = new PhpMessages( 'ci' ); // 'ci' or 'laravel' framework params (default = ci)
$message = $message->mailchimp_edit( $data );
Notifications Manager
Notifications - Insert or Update

Call the "notifications_create_or_update" function to create or update user configuration about many notifications.

$data = [
    'users_id'      => 1,
    'contract_id'   => 1,
    'custom'        => NULL,
    'items'         => [
        [
            'name'          => 'store_new',
            'email'         => 0,
            'pusher'        => 1,
            'smsm'          => 0
        ],[
            'name'          => 'store_stock',
            'email'         => 0,
            'pusher'        => 1,
            'smsm'          => 0
        ]
    ]
];
$message = new PhpMessages( 'ci' ); // 'ci' or 'laravel' framework params (default = ci)
$message = $message->notifications_create_or_update( $data );
Notifications - Get All

Use "notifications_get_all" function to get configurations about all notifications.

$data = [
    'users_id'      => 1,
    'system'        => 'store',
    'custom'        => NULL
];
$message = new PhpMessages( 'ci' ); // 'ci' or 'laravel' framework params (default = ci)
$message = $message->notifications_get_all( $data );
Notifications - Get One

Use "notifications_get_one" function to get configurations about one notifications.

$data = [
    'users_id'      => 1,
    'system'        => 'store',
    'custom'        => NULL
];
$message = new PhpMessages( 'ci' ); // 'ci' or 'laravel' framework params (default = ci)
$message = $message->notifications_get_one( $data );

License

This project is licensed under the MIT License - see the LICENSE.md file for details

epicsweb/php-ci-messages 适用场景与选型建议

epicsweb/php-ci-messages 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.05k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 04 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 epicsweb/php-ci-messages 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-24