Advertisement
Guest User

GetResponse API for NewsLetter

a guest
Jun 10th, 2014
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. require_once 'jsonRPCClient.php';
  2. $api_key = 'APIKEY';
  3. $api_url = 'http://api2.getresponse.com';
  4. $client = new jsonRPCClient($api_url);
  5. $body = file_get_contents('email.html');
  6. # find campaign named 'test'
  7. $campaigns = $client->get_campaigns(
  8. $api_key,
  9. array (
  10. # find by name literally
  11. 'name' => array ( 'EQUALS' => 'abs_prosignal_email_alert' )
  12. )
  13. );
  14.  
  15. $CAMPAIGN_ID = array_pop(array_keys($campaigns));
  16.  
  17.  
  18. $result = $client->send_newsletter(
  19. $api_key,
  20. array (
  21.  
  22.  
  23. "campaign" => $CAMPAIGN_ID,
  24. "from_field" => "support@domain.com",
  25. "reply_to_field" => "support@domain.com",
  26. "subject" => "My newsletter",
  27. "name" =>"Support domain",
  28.  
  29. 'content' => array(
  30. 'html' => 'Some HTML content',
  31. 'plain' => 'Hello there'
  32. )
  33.  
  34.  
  35.  
  36. )
  37. );
  38.  
  39.  
  40. print_r($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement