Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function mailing_create_example(){ | |
53ca8fd7 | 7 | $params = array( |
6a488035 TO |
8 | 'subject' => 'maild', |
9 | 'body_text' => 'bdkfhdskfhduew', | |
10 | 'version' => 3, | |
11 | 'name' => 'mailing name', | |
12 | 'created_id' => 1, | |
13 | ); | |
14 | ||
15 | $result = civicrm_api( 'mailing','create',$params ); | |
16 | ||
17 | return $result; | |
18 | } | |
19 | ||
20 | /* | |
21 | * Function returns array of result expected from previous function | |
22 | */ | |
23 | function mailing_create_expectedresult(){ | |
24 | ||
53ca8fd7 | 25 | $expectedResult = array( |
6a488035 TO |
26 | 'is_error' => 0, |
27 | 'version' => 3, | |
28 | 'count' => 1, | |
29 | 'id' => 1, | |
53ca8fd7 | 30 | 'values' => array( |
31 | '1' => array( | |
6a488035 TO |
32 | 'id' => '1', |
33 | 'domain_id' => '1', | |
34 | 'header_id' => 'null', | |
35 | 'footer_id' => 'null', | |
36 | 'reply_id' => '', | |
37 | 'unsubscribe_id' => '', | |
38 | 'resubscribe_id' => '', | |
39 | 'optout_id' => '', | |
40 | 'name' => 'mailing name', | |
41 | 'from_name' => 'FIXME', | |
42 | 'from_email' => 'info@EXAMPLE.ORG', | |
43 | 'replyto_email' => 'info@EXAMPLE.ORG', | |
44 | 'subject' => 'maild', | |
45 | 'body_text' => 'bdkfhdskfhduew', | |
46 | 'body_html' => '', | |
47 | 'url_tracking' => '1', | |
48 | 'forward_replies' => '', | |
49 | 'auto_responder' => 0, | |
50 | 'open_tracking' => '1', | |
51 | 'is_completed' => '', | |
52 | 'msg_template_id' => '', | |
53 | 'override_verp' => '1', | |
54 | 'created_id' => '1', | |
53ca8fd7 | 55 | 'created_date' => '20120130621222105', |
6a488035 | 56 | 'scheduled_id' => '', |
53ca8fd7 | 57 | 'scheduled_date' => '20130622085501', |
6a488035 | 58 | 'approver_id' => '1', |
53ca8fd7 | 59 | 'approval_date' => '20130622085501', |
6a488035 TO |
60 | 'approval_status_id' => '', |
61 | 'approval_note' => '', | |
62 | 'is_archived' => '', | |
63 | 'visibility' => 'User and User Admin Only', | |
64 | 'campaign_id' => '', | |
65 | 'dedupe_email' => '', | |
66 | 'sms_provider_id' => '', | |
53ca8fd7 | 67 | 'api.mailing_job.create' => array( |
6a488035 TO |
68 | 'is_error' => 0, |
69 | 'version' => 3, | |
70 | 'count' => 1, | |
71 | 'id' => 1, | |
53ca8fd7 | 72 | 'values' => array( |
73 | '0' => array( | |
6a488035 TO |
74 | 'id' => '1', |
75 | 'mailing_id' => '1', | |
53ca8fd7 | 76 | 'scheduled_date' => '20130622085501', |
6a488035 TO |
77 | 'start_date' => '', |
78 | 'end_date' => '', | |
79 | 'status' => 'Scheduled', | |
80 | 'is_test' => 0, | |
81 | 'job_type' => '', | |
82 | 'parent_id' => '', | |
83 | 'job_offset' => '', | |
84 | 'job_limit' => '', | |
85 | ), | |
86 | ), | |
87 | ), | |
88 | ), | |
89 | ), | |
90 | ); | |
91 | ||
92 | return $expectedResult ; | |
93 | } | |
94 | ||
95 | ||
96 | /* | |
97 | * This example has been generated from the API test suite. The test that created it is called | |
98 | * | |
99 | * testMailerCreateSuccess and can be found in | |
100 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/MailingTest.php | |
101 | * | |
102 | * You can see the outcome of the API tests at | |
103 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
104 | * | |
105 | * To Learn about the API read | |
106 | * http://book.civicrm.org/developer/current/techniques/api/ | |
107 | * | |
108 | * and review the wiki at | |
109 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
110 | * | |
111 | * Read more about testing here | |
112 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
113 | * | |
114 | * API Standards documentation: | |
115 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
116 | */ |