Skip to content

Instantly share code, notes, and snippets.

@cmawhorter
Created February 17, 2014 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmawhorter/9044971 to your computer and use it in GitHub Desktop.
Save cmawhorter/9044971 to your computer and use it in GitHub Desktop.
<?php
// Stampr API - Create a Batch for Testing
require 'vendor/autoload.php';
require 'src/Stampr/Stampr.php';
$stampr_login = "your.stampr.login@example.com";
$stampr_password = "your.stampr.password";
$endpoint = "https://stam.pr/api";
$stampr = new Stampr($stampr_login, $stampr_password, $endpoint);
$config = $stampr->factory('Config')->create();
// Save to API
$batch = $stampr->factory('Batch')
->set('config_id', $config->getId())
->set('status', 'hold')
->create();
print "Batch #" . $batch->getId() . " created\n";
// Since the batch status is 'hold', any mailings added to it will not be sent out.
// Warning: Changing the status to 'processing' will trigger all mailings in the batch to be sent immediately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment