Coder Social home page Coder Social logo

silverpopphp's Introduction

Silverpop PHP Client Library

PHP client library for the Silverpop API.

Note. This project is not actively maintained. I suggest if it is useful, you fork your own version of it.

Pull requests that are non-breaking will be merged.

Installation

Installation via composer . Create a composer.json file in the root folder of you project and paste the code below.

{
    "require": {
        "simpleweb/silverpopphp": "master-dev"
    }
}

With composer installed, just run php composer.phar install or simply composer install if you did a global install.

Usage

<?php

// Include the library
require_once 'vendor/autoload.php';

// Require the Silverpop Namespace
use Silverpop\EngagePod;

// Set some useful variables
$databaseID   = 'XXX';
$templateID   = 'XXX';
$contactsList = 'XXX';

// Initialize the library
$silverpop = new EngagePod(array(
  'username'       => 'XXX',
  'password'       => 'XXX',
  'engage_server'  => 4,
));

// Fetch all contact lists
$lists = $silverpop->GetLists(18);
var_dump($lists);

// Add a record to a contact
$recipientID = $silverpop->addContact(
  $databaseID,
  true,
  array(
    'name'  => 'christos',
    'email' => '[email protected]',
  )
);
echo $recipientID;

// Create a new mailing and send in 1 minute
$mailingID = $silverpop->sendEmail(
  $templateID,
  $databaseID,
  'API Mailing Test - ' . date("d/m/Y H:i:s", time()),
  time() + 60,
);
echo $mailingID;

silverpopphp's People

Contributors

dhs avatar feldsam avatar imdevin567 avatar kybersoft avatar leeatengage avatar mimou78 avatar mmcev106 avatar muhammadriyaz avatar r0nn1ef avatar rlonginsp avatar rlweb avatar romulodl avatar th3fallen avatar tholder avatar ukmadlz avatar wolframcheg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

silverpopphp's Issues

Versioned releases

It would be great if releases were tagged so within composer we can make sure we are getting specific releases.

/lib/Silverpop/Util/ArrayToXml.php Rename

For the people that load this repo via Composer your ArrayToXML class name does not match the filename which can cause issues in some os' when autloading please rename this file to ArrayToXML.php

Email Image Upload?

Does anyone know if this module, or if there is even a method at all to automate uploading email images into Silverpop?

OAuth authentication?

Do you support OAuth to access the API?

I look through the code and could not find anything about that, so I thought I should ask here.

Thank you,
Radi.

Nomenclature questions, class constants

Hey Guys,

Thanks for writing what looks like a pretty useful library. I've got a couple of questions:

  • What's with the naming convention? EngagePod4 doesn't make a lot of sense compared to something like SilverpopApiService or SilverpopClient. What's the motivation behind that? For something you hope others to adopt, it'd be great to have a more sensible name for this class.

  • It looks like you've got a bunch of integer values that denote different list types ( https://github.com/simpleweb/SilverpopPHP/blob/master/lib/EngagePod4.php#L41 ). The comments are useful, but from what I've seen, a better practice is to set these as class constants. This would be something like:

    const LIST_TYPE_DATABASE = 0;

It looks like there are some plans to improve documentation, which I'm all for. Constants make the code that consumes this API a bit easier to understand than just passing a strict integer value, and it helps improve documentation because then you can document each constant.

These are just some stray observations. I will likely use this library for some stuff I'd like to work on. So I may contribute these changes back if no one on your end has the time :)

Extend silverpop

I would like to extend it in order to export a list but everything is set as private. Is there a way that you intended for this to be extended?

Need to be able to override _baseURL

My account runs on an instance of Pod5 rather than 4, so I need to be able to set that in the configuration, rather than having it be hard coded.

add addContactToContactList method

When adding email address to a double opt-in database, we first need to use addContact method, followed up with doubleOptInContact to double opt-in the email.

Once the email is double opt-in, need to useaddContactToContactList to assign email to a contact list.

Unable to submit multi-select values

I'm trying to submit data to a "multi-select" field type in Silverpop using the following data;

[title] => mr
[where_purchased] => Array
    (
        [0] => lidl, 
        [1] => mothercare
        [2] => marks and spencer
    )

[your_date_of_birth] => 2000-01-01

But the field is always empty after submission. All other fields are populated correctly.

Error: Class 'Silverpop\Util\ArrayToXML' not found

Hello an thank you for your lib,

I've got an error "Error: Class 'Silverpop\Util\ArrayToXML' not found" because the class name is different from the filename.
This file ArrayToXML.php has to be renamed ArrayToXml because of case sensitivity.

Thank you.

xml2array function problem

I'm having a problem to deploy the new version of this library due an error call to \Silverpop\Util\xml2array. After looking the code I've seen some refactoring would be necessary.

I will raise a pull request (hopefully this week) to make the XML to Array and Array to XML manipulation better...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.