3 * Test Generated example demonstrating the Email.create API.
8 function email_create_example() {
11 'email' => 'api@a-team.com',
16 $result = civicrm_api3('Email', 'create', $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 email_create_expectedresult() {
51 'location_type_id' => '1',
52 'email' => 'api@a-team.com',
57 'hold_date' => '20190820191652',
59 'signature_text' => '',
60 'signature_html' => '',
65 return $expectedResult;
69 * This example has been generated from the API test suite.
70 * The test that created it is called "testEmailOnHold"
71 * and can be found at:
72 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
74 * You can see the outcome of the API tests at
75 * https://test.civicrm.org/job/CiviCRM-Core-Matrix/
77 * To Learn about the API read
78 * https://docs.civicrm.org/dev/en/latest/api/
80 * Browse the API on your own site with the API Explorer. It is in the main
81 * CiviCRM menu, under: Support > Development > API Explorer.
83 * Read more about testing here
84 * https://docs.civicrm.org/dev/en/latest/testing/
86 * API Standards documentation:
87 * https://docs.civicrm.org/dev/en/latest/framework/api-architecture/