Back to Documentation Overview

campaignSendTest

public static campaignSendTest(string uid, string cid, array test_emails, string send_type)

Send a test of this campaign to the provided email address

Section:
Campaign Related
Parameters:
uid the id for your user account. Get by calling login($user, $pass)
cid the id for the campaign to test
test_emails an array of email address to receive the test message
send_type optional - default (null) sends both, "html" or "text" send just that format
Returns:
boolean   -  true on success

Examples (1)

download example code

[1] xml-rpc_campaignSendTest.php

  1. <?php
  2. /**
  3. This Example shows how to immediately Send a Test message for a prepared Campaign
  4. using the XML-RPC service and do some basic error checking.
  5. Note that we are using the PEAR XML-RPC client and recommend others do as well.
  6. **/
  7. require_once 'XML/RPC2/Client.php';
  8. include('inc/config.inc.php'); //contains username & password
  9.  
  10. $client = XML_RPC2_Client::create($apiUrl);
  11. $uuid = $client->login($username,$password);
  12.  
  13. try {
  14. $emails = array($my_email, $boss_man_email);
  15. $result = $client->campaignSendTest($uuid, $campaignId, $emails, '');
  16. echo "SUCCESS! \n";
  17. var_dump($result);
  18. } catch (XML_RPC2_FaultException $e){
  19. echo "ERROR!!!!\n";
  20. echo $e->getFaultCode()." : ".$e->getFaultString()."\n";
  21. }
  22. ?>
  23.  
  24.  
Add New Note User Contributed Notes for campaignSendTest
No notes, yet... Will you be the first??