ffaae8983dd93e0a0ea4cf2672a862a206b9fdd7
3 * Test Generated example demonstrating the Mailing.submit API.
8 function mailing_submit_example() {
10 'scheduled_date' => '2014-12-13 10:00:00',
11 'approval_date' => '2014-12-13 00:00:00',
16 $result = civicrm_api3('Mailing', 'submit', $params);
18 catch (CiviCRM_API3_Exception
$e) {
20 $errorMessage = $e->getMessage();
21 $errorCode = $e->getErrorCode();
22 $errorData = $e->getExtraParams();
25 'error_message' => $errorMessage,
26 'error_code' => $errorCode,
27 'error_data' => $errorData,
35 * Function returns array of result expected from previous function.
40 function mailing_submit_expectedresult() {
42 $expectedResult = array(
54 'unsubscribe_id' => '5',
55 'resubscribe_id' => '6',
57 'name' => 'mailing name',
58 'mailing_type' => 'standalone',
59 'from_name' => 'FIXME',
60 'from_email' => 'info@EXAMPLE.ORG',
61 'replyto_email' => 'info@EXAMPLE.ORG',
62 'template_type' => 'traditional',
63 'template_options' => '',
64 'subject' => 'Hello {contact.display_name}',
65 'body_text' => 'This is {contact.display_name}.
67 {domain.address}{action.optOutUrl}',
68 'body_html' => '<p>Look ma, magic tokens in the markup!</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' => '41',
79 'scheduled_date' => '20130728085413',
80 'approver_id' => '41',
81 'approval_date' => '20130728085413',
82 'approval_status_id' => '1',
83 'approval_note' => '',
85 'visibility' => 'Public Pages',
87 'dedupe_email' => '1',
88 'sms_provider_id' => '',
89 'hash' => '67eac7789eaee00',
90 'location_type_id' => '',
91 'email_selection_method' => 'automatic',
97 return $expectedResult;
101 * This example has been generated from the API test suite.
102 * The test that created it is called "testMailerSubmit"
103 * and can be found at:
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
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