承接 wondeotec/emailbidding-sdk 相关项目开发

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

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

wondeotec/emailbidding-sdk

Composer 安装命令:

composer require wondeotec/emailbidding-sdk

包简介

Collection of scripts to allow interactions with Emailbidding API

README 文档

README

This SDK serves to help Emailbiddings's publishers to integrate their systems with Emailbidding platform.

Requirements

You'll need to be install on your server the PHP 5.4 version or higher and add the package 'wondeotec/emailbidding-sdk' to you composer dependencies.

Webhooks

If you are an Emailbidding publisher, then you can subscribe an endpoint and listen Emailbidding's events such as unsubscriptions, soft bounces, hard bounces, clicks or even opens.

This SDK helps you on testing your test to be able to receive an webhook event. Emailbidding system always send an HTTP POST request to the given endpoint with an JSON object on body identical to the following:

{
  "ip_address":"127.0.0.1",
  "action":"unsubscription",
  "campaign_id":6368,
  "list_external_id":"my_list",
  "reason":"user_request",
  "recipient_email_address":"email@domain.com",
  "hash":"8d4ba2b6fc195d3f95039377ac7208e6",
  "recipient_external_id":"5556664",
  "trigger_date":"2015-09-03 11:13:34",
  "type":"unsubscription"
}

This SDK provides you an object to send webhooks to your endpoint in the same way as the Emailbidding system will send to you on the production environment.

The object 'EB\SDK\Webhook\Webhook' has a single method that accepts a payload and and endpoint. You can create an object of type 'EB\SDK\Webhook\Payload', or you just can 'ask' to 'EB\SDK\Webhook\Payload' to create an simple object to you. See the following example:

<?php

(...)
use EB\SDK\Webhook\PayloadFactory;
use EB\SDK\Webhook\Webhook;
(...)

$webhook = new Webhook();
$success = $webhook->post(
    PayloadFactory::createOpen('email@domain.com', 'my_list'),
    'https://your.secure.server/endpoint'
));

Recipient subscribe

Emailbidding recipient subscribe API allow you to upload your database to Emailbidding platform. You have to distinct methods to submit your recipients: simple and anonymous integration. This SDK helps you on the integration providing you an 'EB\SDK\RecipientSubscribe\RecipientSubscribe' object that you can instantiate with 'EB\SDK\RecipientSubscribe\Recipient' objects and then you just need to post the recipients data to Emailbidding. Take the following example in consideration:

<?php
(...)
use EB\SDK\RecipientSubscribe\RecipientSubscribe;
use EB\SDK\RecipientSubscribe\RecipientFactory;
(...)

// ** RECIPIENT SUBSCRIBE ** //
// Creating a recipient subscribe object with my credentials
$recipientSubscribe = new RecipientSubscribe('YOUR_PUBLISHER_API_KEY', 'YOUR_PUBLISHER_API_SECRET');

// Posting an simple recipient (minimal information) to Emailbidding API and dumping the result
var_dump($recipientSubscribe->post(
    array(RecipientFactory::createSimpleRecipient('email@domain.com', 'FR')),
    YOUR_PUBLISHER_ID,
    'my_best_database'
));

// Posting an anonymous recipient to Emailbidding (NOTE: the email address WILL NOT be sent to Emailbidding)
// The email address 'email@domain.com' will be transformed in '7328fddefd53de471baeb6e2b764f78a'
var_dump($recipientSubscribe->post(
    array(RecipientFactory::createSimpleAnonymousRecipient('email@domain.com', 'FR')),
    YOUR_PUBLISHER_ID,
    'my_best_database'
));

Server to Server Submission

Emailbidding SDK allows you, as an advertiser, to submit your conversion to Emailbidding platform. In order to use this API you need to grab you advertiser EB API key and secret.

The Emailbidding S2S API accepts an HTTP POST with the following JSON as payload:

{
    "conversion":{
    "subid":"123456",
    "description":"Test conversion",
    "details":{
        "conversion_date":"1970-01-01",
        "revenue":1.23,
        "total_conversions":1,
        "ip_address":"127.0.0.1",
        "conversion_type":"click",
        "link_position":1
    }
  }
}

Below, you will find a snippet of PHP code that show you how to send conversion data using Emailbidding conversion API.

<?php

(...)

// Set your credentials
$apiKey       = 'YOUR_API_KEY';
$apiSecret    = 'YOUR_API_SECRET';
$advertiserId = 'YOUR_ADVERTISER_ID';

// Set your conversion details
$conversionDetails = new Details(1.23, new \DateTime(), 1);
$conversion        = new Conversion('123456', 'Test conversion', $conversionDetails);

// Submit your conversion
$conversionSubmit  = new ConversionSubmit($advertiserId, $apiKey, $apiSecret);
$conversionSubmit->post($conversion);

For more examples you can clone the following project from github: https://github.com/wondeotec/sample-emailbidding-sdk

wondeotec/emailbidding-sdk 适用场景与选型建议

wondeotec/emailbidding-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.1k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 10 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 wondeotec/emailbidding-sdk 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-06