定制 dreamcampaigns/managesend-php 二次开发

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

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

dreamcampaigns/managesend-php

Composer 安装命令:

composer require dreamcampaigns/managesend-php

包简介

A php library which implements the complete functionality of the DreamCampaigns API.

README 文档

README

Travis (.org) Packagist Packagist Version Packagist

A PHP library implementing the complete functionality of the DreamCampaigns API. A complete suites of marketing tools for your business or website.

Supported PHP Versions

This library supports the following PHP implementations:

  • PHP 5.3
  • PHP 5.4
  • PHP 5.5
  • PHP 5.6
  • PHP 7.0
  • PHP 7.1
  • PHP 7.2
  • PHP 7.3
  • PHP 7.4

Installation

You can install managesend-php via composer or by downloading the source.

Via Composer

managesend-php is available on Packagist as the dreamcampaigns/managesend-php package.

If you use Composer, you can run the following command from the root of your project to install:

composer require dreamcampaigns/managesend-php

Manual Installation

If youn't use Composer you can simply download the library and include it in your project.

After you have installed the library, if you need an autoloader, simply include the managesend-php autoload class, as follows:

require_once __DIR__ . '/../managesend-php/autoLoader/autoload.php';

Authenticating

The DreamCampaigns API uses Basic authentication using an API key and API secret.

Quickstart

Send a Smart email

// Send a Smart email using DreamCampaigns's REST API and PHP
<?php
$apiKey = "ACXXXXXX"; // Your Account/Client API Key from https://login.managesend.com/myaccount/apikeys
$apiSecret = "YXYXYX"; // Your Account/Client API Secret from https://login.managesend.com/myaccount/apikeys
$clientId = "a6hsgw74dw0001om4yrgfen8";

$restClient = new \Managesend\RestClient($apiKey, $apiSecret, $clientId);
$result = $restClient->transactional()->sendSmartEmail("c5is8tltkk00018k9ype5lg741",array(
    "toEmail"=>"joe@example.com",
    "toName"=>"Joe Smith",
    "data"=>array("promoCode"=>"XYZ"),
));
$newEmail = $result->getData();

//your IDE should auto generate all available getters for each call & results
print $newEmail->getMessageId();
print $newEmail->getStatus();

//or if you preffer arrays

print_r($newEmail->toArray());

//or you can get the response, where you can get all available data & headers as array

$response = $result->getResponse();

Send a Smart SMS

// Send a Dynamic SMS using DreamCampaigns's REST API and PHP
<?php
$apiKey = "ACXXXXXX"; // Your Account API Key from https://login.managesend.com/myaccount/apikeys
$apiSecret = "YXYXYX"; // Your Account API Secret from https://login.managesend.com/myaccount/apikeys

//if you are using your account level api keys you can set the client ids for each call.
$restClient = new \Managesend\RestClient($apiKey, $apiSecret);
$result = $restClient->setClientId("c5is8tltkk00018k9ype5lg741")->transactional()->sendDynamicSms("c5is8tltkk00018k9ype5lg741",array(
    "toNumber"=>"+1234567891",
    "content"=>"Hello Joe, your password has been reset.",
));
$newSms = $result->getData();

print $newEmail->getMessageId();

Getting sent email campaigns

<?php
$result = $restClient->emailCampaign()->getCampaignsSent();
$campaigns = $result->getData();
foreach ($campaigns as $campaign){
    print $campaign->getSentDate();
}

Using .env

If you're using .env, you can set your API credentials in your .env.

MANAGESEND_TOKEN_KEY=ACXXXXXX
MANAGESEND_TOKEN_SECRET=YXYXYX
MANAGESEND_CLIENT_ID=c5is8tltkk00018k9ype5lg741
<?php
$restClient = new \Managesend\RestClient();
$result = $restClient->lists()->getSubscriberList("joe@example.com");

Examples

Samples for creating or accessing all resources can be found in the examples directory.

Documentation

For more details you can reffer to the DreamCampaigns API documentations

dreamcampaigns/managesend-php 适用场景与选型建议

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-07