Created
February 17, 2014 04:55
-
-
Save cmawhorter/9044971 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Stampr API - Create a Batch for Testing | |
require 'vendor/autoload.php'; | |
require 'src/Stampr/Stampr.php'; | |
$stampr_login = "[email protected]"; | |
$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