4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using mailing submit API.
15 function mailing_submit_example() {
17 'scheduled_date' => '2014-12-13 10:00:00',
22 $result = civicrm_api3('mailing', 'submit', $params);
24 catch (CiviCRM_API3_Exception
$e) {
26 $errorMessage = $e->getMessage();
27 $errorCode = $e->getErrorCode();
28 $errorData = $e->getExtraParams();
30 'error' => $errorMessage,
31 'error_code' => $errorCode,
32 'error_data' => $errorData,
40 * Function returns array of result expected from previous function.
45 function mailing_submit_expectedresult() {
47 $expectedResult = array(
59 'unsubscribe_id' => '',
60 'resubscribe_id' => '',
62 'name' => 'mailing name',
63 'from_name' => 'FIXME',
64 'from_email' => 'info@EXAMPLE.ORG',
65 'replyto_email' => 'info@EXAMPLE.ORG',
66 'subject' => 'Hello {contact.display_name}',
67 'body_text' => 'This is {contact.display_name}',
68 'body_html' => '<p>This is {contact.display_name}</p>',
69 'url_tracking' => '1',
70 'forward_replies' => 0,
71 'auto_responder' => 0,
72 'open_tracking' => '1',
74 'msg_template_id' => '',
75 'override_verp' => '1',
77 'created_date' => '2013-07-28 08:49:19',
78 'scheduled_id' => '22',
79 'scheduled_date' => '20130728085413',
81 'approval_date' => '',
82 'approval_status_id' => '',
83 'approval_note' => '',
85 'visibility' => 'Public Pages',
88 'sms_provider_id' => '',
89 'hash' => '67eac7789eaee00',
90 'location_type_id' => '',
91 'email_selection_method' => '',
96 return $expectedResult;
100 * This example has been generated from the API test suite.
101 * The test that created it is called
103 * and can be found in
104 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php
106 * You can see the outcome of the API tests at
107 * https://test.civicrm.org/job/CiviCRM-master-git/
109 * To Learn about the API read
110 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
112 * Browse the api on your own site with the api explorer
113 * http://MYSITE.ORG/path/to/civicrm/api/explorer
115 * Read more about testing here
116 * http://wiki.civicrm.org/confluence/display/CRM/Testing
118 * API Standards documentation:
119 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards