定制 xlabs/ynotmailbundle 二次开发

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

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

xlabs/ynotmailbundle

Composer 安装命令:

composer require xlabs/ynotmailbundle

包简介

YNotMail bundle

README 文档

README

YNot Mail API wrapper.

Installation

Install through composer:

php -d memory_limit=-1 composer.phar require xlabs/ynotmailbundle

In your AppKernel

public function registerbundles()
{
    return [
    	...
    	...
    	new XLabs\YNotMailBundle\XLabsYNotMailBundle(),
    ];
}

Add the following command as a crontab to update YNotMail user lists:

55 23 * * * /usr/bin/php <symfony_project_folder>/bin/console cron:daily:ynot:update_lists

Configuration sample

Default values are shown below:

# app/config/config.yml

x_labs_ynot_mail:
    api:
        url: 'https://www.ynotmail.com/clients/remote-api.php'
        username: ############
        token: ############
    lists:
        expired_members: {id: xxxx, query: "SELECT * FROM..."}
        alias_2: {id: <list_id_2>, query: "SELECT * FROM..."}
        ...
        alias_N: {id: <list_id_N>, query: "SELECT * FROM..."}
        ...

Usage

Instantiate the service from a Controller by:

$api = $this->get('xlabs_ynot_mail');

Then use the "_call" method to perform the request, which uses 3 parameters: method, parameters, and multiple flag. If "multiple" is true, it will expect an array of parameters. If the parameter was already an array, it will expect an array of arrays.

Methods

Create list

$api->_call('createList', array(
    'name' => 'test',
    'ownerEmail' => 'test_owner@mm.com',
    'ownerName' => 'test',
    'replyEmail' => 'test_reply@mm.com',
    'companyName' => 'test',
    'companyAddress' => 'test',
    'companyPhones' => 'test'
));

Get lists

$api->_call('getLists');

Delete list

$api->_call('deleteList', $list_id);

Add subscriber to list

$api->_call('addSubscriberToList', array(
    'listId' => $list_id,
    'subscriber' => array(
        'email' => 'my@email.com',
        'format' => 'html'
    )
));

A multiple call to add multiple subscribers to a list would look as follows:

$api->_call('addSubscriberToList', array(
    array(
        'listId' => $list_id,
        'subscriber' => array(
            'email' => 'first@email.com',
            'format' => 'html'
        )
    ),
    array(
        'listId' => $list_id,
        'subscriber' => array(
            'email' => 'second@email.com',
            'format' => 'html'
        )
    )
), $multiple = true);

Delete subscriber from list

$api->_call('deleteSubscriber', array(
    'listId' => $list_id,
    'subscriberId' => 'my@email.com'
));

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固