First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
118
sites/all/modules/civicrm/api/v3/examples/Mailing/Clone.php
Normal file
118
sites/all/modules/civicrm/api/v3/examples/Mailing/Clone.php
Normal file
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
/**
|
||||
* Test Generated example demonstrating the Mailing.clone API.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_clone_example() {
|
||||
$params = array(
|
||||
'id' => 21,
|
||||
);
|
||||
|
||||
try{
|
||||
$result = civicrm_api3('Mailing', 'clone', $params);
|
||||
}
|
||||
catch (CiviCRM_API3_Exception $e) {
|
||||
// Handle error here.
|
||||
$errorMessage = $e->getMessage();
|
||||
$errorCode = $e->getErrorCode();
|
||||
$errorData = $e->getExtraParams();
|
||||
return array(
|
||||
'is_error' => 1,
|
||||
'error_message' => $errorMessage,
|
||||
'error_code' => $errorCode,
|
||||
'error_data' => $errorData,
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function returns array of result expected from previous function.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_clone_expectedresult() {
|
||||
|
||||
$expectedResult = array(
|
||||
'is_error' => 0,
|
||||
'version' => 3,
|
||||
'count' => 1,
|
||||
'id' => 22,
|
||||
'values' => array(
|
||||
'22' => array(
|
||||
'id' => '22',
|
||||
'domain_id' => '1',
|
||||
'header_id' => '1',
|
||||
'footer_id' => '2',
|
||||
'reply_id' => '8',
|
||||
'unsubscribe_id' => '5',
|
||||
'resubscribe_id' => '6',
|
||||
'optout_id' => '7',
|
||||
'name' => 'mailing name',
|
||||
'mailing_type' => 'standalone',
|
||||
'from_name' => 'FIXME',
|
||||
'from_email' => 'info@EXAMPLE.ORG',
|
||||
'replyto_email' => 'info@EXAMPLE.ORG',
|
||||
'template_type' => 'traditional',
|
||||
'template_options' => '',
|
||||
'subject' => 'Hello {contact.display_name}',
|
||||
'body_text' => 'This is {contact.display_name}.
|
||||
https://civicrm.org
|
||||
{domain.address}{action.optOutUrl}',
|
||||
'body_html' => '<p>This is {contact.display_name}.</p><p><a href=\'https://civicrm.org/\'>CiviCRM.org</a></p><p>{domain.address}{action.optOutUrl}</p>',
|
||||
'url_tracking' => '1',
|
||||
'forward_replies' => 0,
|
||||
'auto_responder' => 0,
|
||||
'open_tracking' => '1',
|
||||
'is_completed' => '',
|
||||
'msg_template_id' => '',
|
||||
'override_verp' => '1',
|
||||
'created_id' => '147',
|
||||
'created_date' => '2013-07-28 08:49:19',
|
||||
'scheduled_id' => '',
|
||||
'scheduled_date' => '',
|
||||
'approver_id' => '',
|
||||
'approval_date' => '',
|
||||
'approval_status_id' => '',
|
||||
'approval_note' => '',
|
||||
'is_archived' => '',
|
||||
'visibility' => 'Public Pages',
|
||||
'campaign_id' => '',
|
||||
'dedupe_email' => '1',
|
||||
'sms_provider_id' => '',
|
||||
'hash' => '',
|
||||
'location_type_id' => '',
|
||||
'email_selection_method' => 'automatic',
|
||||
'language' => '',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return $expectedResult;
|
||||
}
|
||||
|
||||
/*
|
||||
* This example has been generated from the API test suite.
|
||||
* The test that created it is called "testClone"
|
||||
* and can be found at:
|
||||
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php
|
||||
*
|
||||
* You can see the outcome of the API tests at
|
||||
* https://test.civicrm.org/job/CiviCRM-master-git/
|
||||
*
|
||||
* To Learn about the API read
|
||||
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
|
||||
*
|
||||
* Browse the api on your own site with the api explorer
|
||||
* http://MYSITE.ORG/path/to/civicrm/api
|
||||
*
|
||||
* Read more about testing here
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/Testing
|
||||
*
|
||||
* API Standards documentation:
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
|
||||
*/
|
188
sites/all/modules/civicrm/api/v3/examples/Mailing/Create.php
Normal file
188
sites/all/modules/civicrm/api/v3/examples/Mailing/Create.php
Normal file
|
@ -0,0 +1,188 @@
|
|||
<?php
|
||||
/**
|
||||
* Test Generated example demonstrating the Mailing.create API.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_create_example() {
|
||||
$params = array(
|
||||
'subject' => 'Hello {contact.display_name}',
|
||||
'body_text' => 'This is {contact.display_name}.
|
||||
https://civicrm.org
|
||||
{domain.address}{action.optOutUrl}',
|
||||
'body_html' => '<p>This is {contact.display_name}.</p><p><a href=\'https://civicrm.org/\'>CiviCRM.org</a></p><p>{domain.address}{action.optOutUrl}</p>',
|
||||
'name' => 'mailing name',
|
||||
'created_id' => 3,
|
||||
'header_id' => '',
|
||||
'footer_id' => '',
|
||||
'groups' => array(
|
||||
'include' => array(
|
||||
'0' => 2,
|
||||
),
|
||||
'exclude' => array(
|
||||
'0' => 3,
|
||||
),
|
||||
),
|
||||
'mailings' => array(
|
||||
'include' => array(),
|
||||
'exclude' => array(),
|
||||
),
|
||||
'options' => array(
|
||||
'force_rollback' => 1,
|
||||
),
|
||||
'api.mailing_job.create' => 1,
|
||||
'api.MailingRecipients.get' => array(
|
||||
'mailing_id' => '$value.id',
|
||||
'api.contact.getvalue' => array(
|
||||
'return' => 'display_name',
|
||||
),
|
||||
'api.email.getvalue' => array(
|
||||
'return' => 'email',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
try{
|
||||
$result = civicrm_api3('Mailing', 'create', $params);
|
||||
}
|
||||
catch (CiviCRM_API3_Exception $e) {
|
||||
// Handle error here.
|
||||
$errorMessage = $e->getMessage();
|
||||
$errorCode = $e->getErrorCode();
|
||||
$errorData = $e->getExtraParams();
|
||||
return array(
|
||||
'is_error' => 1,
|
||||
'error_message' => $errorMessage,
|
||||
'error_code' => $errorCode,
|
||||
'error_data' => $errorData,
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function returns array of result expected from previous function.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_create_expectedresult() {
|
||||
|
||||
$expectedResult = array(
|
||||
'is_error' => 0,
|
||||
'version' => 3,
|
||||
'count' => 1,
|
||||
'id' => 1,
|
||||
'values' => array(
|
||||
'1' => array(
|
||||
'id' => '1',
|
||||
'domain_id' => '1',
|
||||
'header_id' => '',
|
||||
'footer_id' => '',
|
||||
'reply_id' => '8',
|
||||
'unsubscribe_id' => '5',
|
||||
'resubscribe_id' => '6',
|
||||
'optout_id' => '7',
|
||||
'name' => 'mailing name',
|
||||
'mailing_type' => 'standalone',
|
||||
'from_name' => 'FIXME',
|
||||
'from_email' => 'info@EXAMPLE.ORG',
|
||||
'replyto_email' => 'info@EXAMPLE.ORG',
|
||||
'template_type' => '',
|
||||
'template_options' => '',
|
||||
'subject' => 'Hello {contact.display_name}',
|
||||
'body_text' => 'This is {contact.display_name}.
|
||||
https://civicrm.org
|
||||
{domain.address}{action.optOutUrl}',
|
||||
'body_html' => '<p>This is {contact.display_name}.</p><p><a href=\'https://civicrm.org/\'>CiviCRM.org</a></p><p>{domain.address}{action.optOutUrl}</p>',
|
||||
'url_tracking' => '1',
|
||||
'forward_replies' => '',
|
||||
'auto_responder' => '',
|
||||
'open_tracking' => '1',
|
||||
'is_completed' => '',
|
||||
'msg_template_id' => '',
|
||||
'override_verp' => '1',
|
||||
'created_id' => '3',
|
||||
'created_date' => '2013-07-28 08:49:19',
|
||||
'scheduled_id' => '',
|
||||
'scheduled_date' => '',
|
||||
'approver_id' => '',
|
||||
'approval_date' => '',
|
||||
'approval_status_id' => '',
|
||||
'approval_note' => '',
|
||||
'is_archived' => '',
|
||||
'visibility' => 'Public Pages',
|
||||
'campaign_id' => '',
|
||||
'dedupe_email' => '1',
|
||||
'sms_provider_id' => '',
|
||||
'hash' => '',
|
||||
'location_type_id' => '',
|
||||
'email_selection_method' => '',
|
||||
'language' => '',
|
||||
'api.mailing_job.create' => array(
|
||||
'is_error' => 0,
|
||||
'version' => 3,
|
||||
'count' => 1,
|
||||
'id' => 1,
|
||||
'values' => array(
|
||||
'0' => array(
|
||||
'id' => '1',
|
||||
'mailing_id' => '1',
|
||||
'scheduled_date' => '20130728085413',
|
||||
'start_date' => '',
|
||||
'end_date' => '',
|
||||
'status' => 'Scheduled',
|
||||
'is_test' => 0,
|
||||
'job_type' => '',
|
||||
'parent_id' => '',
|
||||
'job_offset' => '',
|
||||
'job_limit' => '',
|
||||
),
|
||||
),
|
||||
),
|
||||
'api.MailingRecipients.get' => array(
|
||||
'is_error' => 0,
|
||||
'version' => 3,
|
||||
'count' => 1,
|
||||
'id' => 1,
|
||||
'values' => array(
|
||||
'0' => array(
|
||||
'id' => '1',
|
||||
'mailing_id' => '1',
|
||||
'contact_id' => '4',
|
||||
'email_id' => '4',
|
||||
'api.contact.getvalue' => 'Mr. Includer Person II',
|
||||
'api.email.getvalue' => 'include.me@example.org',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return $expectedResult;
|
||||
}
|
||||
|
||||
/*
|
||||
* This example has been generated from the API test suite.
|
||||
* The test that created it is called "testMailerPreviewRecipients"
|
||||
* and can be found at:
|
||||
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php
|
||||
*
|
||||
* You can see the outcome of the API tests at
|
||||
* https://test.civicrm.org/job/CiviCRM-master-git/
|
||||
*
|
||||
* To Learn about the API read
|
||||
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
|
||||
*
|
||||
* Browse the api on your own site with the api explorer
|
||||
* http://MYSITE.ORG/path/to/civicrm/api
|
||||
*
|
||||
* Read more about testing here
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/Testing
|
||||
*
|
||||
* API Standards documentation:
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
|
||||
*/
|
70
sites/all/modules/civicrm/api/v3/examples/Mailing/Delete.php
Normal file
70
sites/all/modules/civicrm/api/v3/examples/Mailing/Delete.php
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
/**
|
||||
* Test Generated example demonstrating the Mailing.delete API.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_delete_example() {
|
||||
$params = array(
|
||||
'id' => 20,
|
||||
);
|
||||
|
||||
try{
|
||||
$result = civicrm_api3('Mailing', 'delete', $params);
|
||||
}
|
||||
catch (CiviCRM_API3_Exception $e) {
|
||||
// Handle error here.
|
||||
$errorMessage = $e->getMessage();
|
||||
$errorCode = $e->getErrorCode();
|
||||
$errorData = $e->getExtraParams();
|
||||
return array(
|
||||
'is_error' => 1,
|
||||
'error_message' => $errorMessage,
|
||||
'error_code' => $errorCode,
|
||||
'error_data' => $errorData,
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function returns array of result expected from previous function.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_delete_expectedresult() {
|
||||
|
||||
$expectedResult = array(
|
||||
'is_error' => 0,
|
||||
'version' => 3,
|
||||
'count' => 1,
|
||||
'values' => 1,
|
||||
);
|
||||
|
||||
return $expectedResult;
|
||||
}
|
||||
|
||||
/*
|
||||
* This example has been generated from the API test suite.
|
||||
* The test that created it is called "testMailerDeleteSuccess"
|
||||
* and can be found at:
|
||||
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php
|
||||
*
|
||||
* You can see the outcome of the API tests at
|
||||
* https://test.civicrm.org/job/CiviCRM-master-git/
|
||||
*
|
||||
* To Learn about the API read
|
||||
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
|
||||
*
|
||||
* Browse the api on your own site with the api explorer
|
||||
* http://MYSITE.ORG/path/to/civicrm/api
|
||||
*
|
||||
* Read more about testing here
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/Testing
|
||||
*
|
||||
* API Standards documentation:
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
|
||||
*/
|
160
sites/all/modules/civicrm/api/v3/examples/Mailing/GetTokens.php
Normal file
160
sites/all/modules/civicrm/api/v3/examples/Mailing/GetTokens.php
Normal file
|
@ -0,0 +1,160 @@
|
|||
<?php
|
||||
/**
|
||||
* Test Generated example demonstrating the Mailing.gettokens API.
|
||||
*
|
||||
* Demonstrates fetching tokens for one or more entities (in this case "Contact" and "Mailing").
|
||||
* Optionally pass sequential=1 to have output ready-formatted for the select2 widget.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_gettokens_example() {
|
||||
$params = array(
|
||||
'entity' => array(
|
||||
'0' => 'Contact',
|
||||
'1' => 'Mailing',
|
||||
),
|
||||
);
|
||||
|
||||
try{
|
||||
$result = civicrm_api3('Mailing', 'gettokens', $params);
|
||||
}
|
||||
catch (CiviCRM_API3_Exception $e) {
|
||||
// Handle error here.
|
||||
$errorMessage = $e->getMessage();
|
||||
$errorCode = $e->getErrorCode();
|
||||
$errorData = $e->getExtraParams();
|
||||
return array(
|
||||
'is_error' => 1,
|
||||
'error_message' => $errorMessage,
|
||||
'error_code' => $errorCode,
|
||||
'error_data' => $errorData,
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function returns array of result expected from previous function.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_gettokens_expectedresult() {
|
||||
|
||||
$expectedResult = array(
|
||||
'is_error' => 0,
|
||||
'version' => 3,
|
||||
'count' => 82,
|
||||
'values' => array(
|
||||
'{action.unsubscribe}' => 'Unsubscribe via email',
|
||||
'{action.unsubscribeUrl}' => 'Unsubscribe via web page',
|
||||
'{action.resubscribe}' => 'Resubscribe via email',
|
||||
'{action.resubscribeUrl}' => 'Resubscribe via web page',
|
||||
'{action.optOut}' => 'Opt out via email',
|
||||
'{action.optOutUrl}' => 'Opt out via web page',
|
||||
'{action.forward}' => 'Forward this email (link)',
|
||||
'{action.reply}' => 'Reply to this email (link)',
|
||||
'{action.subscribeUrl}' => 'Subscribe via web page',
|
||||
'{domain.name}' => 'Domain name',
|
||||
'{domain.address}' => 'Domain (organization) address',
|
||||
'{domain.phone}' => 'Domain (organization) phone',
|
||||
'{domain.email}' => 'Domain (organization) email',
|
||||
'{mailing.name}' => 'Mailing name',
|
||||
'{mailing.group}' => 'Mailing group',
|
||||
'{mailing.viewUrl}' => 'Mailing permalink',
|
||||
'{contact.contact_type}' => 'Contact Type',
|
||||
'{contact.do_not_email}' => 'Do Not Email',
|
||||
'{contact.do_not_phone}' => 'Do Not Phone',
|
||||
'{contact.do_not_mail}' => 'Do Not Mail',
|
||||
'{contact.do_not_sms}' => 'Do Not Sms',
|
||||
'{contact.do_not_trade}' => 'Do Not Trade',
|
||||
'{contact.is_opt_out}' => 'No Bulk Emails (User Opt Out)',
|
||||
'{contact.external_identifier}' => 'External Identifier',
|
||||
'{contact.sort_name}' => 'Sort Name',
|
||||
'{contact.display_name}' => 'Display Name',
|
||||
'{contact.nick_name}' => 'Nickname',
|
||||
'{contact.image_URL}' => 'Image Url',
|
||||
'{contact.preferred_communication_method}' => 'Preferred Communication Method',
|
||||
'{contact.preferred_language}' => 'Preferred Language',
|
||||
'{contact.preferred_mail_format}' => 'Preferred Mail Format',
|
||||
'{contact.hash}' => 'Contact Hash',
|
||||
'{contact.contact_source}' => 'Contact Source',
|
||||
'{contact.first_name}' => 'First Name',
|
||||
'{contact.middle_name}' => 'Middle Name',
|
||||
'{contact.last_name}' => 'Last Name',
|
||||
'{contact.individual_prefix}' => 'Individual Prefix',
|
||||
'{contact.individual_suffix}' => 'Individual Suffix',
|
||||
'{contact.formal_title}' => 'Formal Title',
|
||||
'{contact.communication_style}' => 'Communication Style',
|
||||
'{contact.job_title}' => 'Job Title',
|
||||
'{contact.gender}' => 'Gender',
|
||||
'{contact.birth_date}' => 'Birth Date',
|
||||
'{contact.current_employer_id}' => 'Current Employer ID',
|
||||
'{contact.contact_is_deleted}' => 'Contact is in Trash',
|
||||
'{contact.created_date}' => 'Created Date',
|
||||
'{contact.modified_date}' => 'Modified Date',
|
||||
'{contact.addressee}' => 'Addressee',
|
||||
'{contact.email_greeting}' => 'Email Greeting',
|
||||
'{contact.postal_greeting}' => 'Postal Greeting',
|
||||
'{contact.current_employer}' => 'Current Employer',
|
||||
'{contact.location_type}' => 'Location Type',
|
||||
'{contact.street_address}' => 'Street Address',
|
||||
'{contact.street_number}' => 'Street Number',
|
||||
'{contact.street_number_suffix}' => 'Street Number Suffix',
|
||||
'{contact.street_name}' => 'Street Name',
|
||||
'{contact.street_unit}' => 'Street Unit',
|
||||
'{contact.supplemental_address_1}' => 'Supplemental Address 1',
|
||||
'{contact.supplemental_address_2}' => 'Supplemental Address 2',
|
||||
'{contact.supplemental_address_3}' => 'Supplemental Address 3',
|
||||
'{contact.city}' => 'City',
|
||||
'{contact.postal_code_suffix}' => 'Postal Code Suffix',
|
||||
'{contact.postal_code}' => 'Postal Code',
|
||||
'{contact.geo_code_1}' => 'Latitude',
|
||||
'{contact.geo_code_2}' => 'Longitude',
|
||||
'{contact.address_name}' => 'Address Name',
|
||||
'{contact.master_id}' => 'Master Address Belongs To',
|
||||
'{contact.county}' => 'County',
|
||||
'{contact.state_province}' => 'State',
|
||||
'{contact.country}' => 'Country',
|
||||
'{contact.phone}' => 'Phone',
|
||||
'{contact.phone_ext}' => 'Phone Extension',
|
||||
'{contact.email}' => 'Email',
|
||||
'{contact.on_hold}' => 'On Hold',
|
||||
'{contact.signature_text}' => 'Signature Text',
|
||||
'{contact.signature_html}' => 'Signature Html',
|
||||
'{contact.im_provider}' => 'IM Provider',
|
||||
'{contact.im}' => 'IM Screen Name',
|
||||
'{contact.openid}' => 'OpenID',
|
||||
'{contact.world_region}' => 'World Region',
|
||||
'{contact.url}' => 'Website',
|
||||
'{contact.checksum}' => 'Checksum',
|
||||
'{contact.contact_id}' => 'Internal Contact ID',
|
||||
),
|
||||
);
|
||||
|
||||
return $expectedResult;
|
||||
}
|
||||
|
||||
/*
|
||||
* This example has been generated from the API test suite.
|
||||
* The test that created it is called "testMailGetTokens"
|
||||
* and can be found at:
|
||||
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php
|
||||
*
|
||||
* You can see the outcome of the API tests at
|
||||
* https://test.civicrm.org/job/CiviCRM-master-git/
|
||||
*
|
||||
* To Learn about the API read
|
||||
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
|
||||
*
|
||||
* Browse the api on your own site with the api explorer
|
||||
* http://MYSITE.ORG/path/to/civicrm/api
|
||||
*
|
||||
* Read more about testing here
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/Testing
|
||||
*
|
||||
* API Standards documentation:
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
|
||||
*/
|
120
sites/all/modules/civicrm/api/v3/examples/Mailing/Submit.php
Normal file
120
sites/all/modules/civicrm/api/v3/examples/Mailing/Submit.php
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
/**
|
||||
* Test Generated example demonstrating the Mailing.submit API.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_submit_example() {
|
||||
$params = array(
|
||||
'scheduled_date' => '2014-12-13 10:00:00',
|
||||
'approval_date' => '2014-12-13 00:00:00',
|
||||
'id' => 18,
|
||||
);
|
||||
|
||||
try{
|
||||
$result = civicrm_api3('Mailing', 'submit', $params);
|
||||
}
|
||||
catch (CiviCRM_API3_Exception $e) {
|
||||
// Handle error here.
|
||||
$errorMessage = $e->getMessage();
|
||||
$errorCode = $e->getErrorCode();
|
||||
$errorData = $e->getExtraParams();
|
||||
return array(
|
||||
'is_error' => 1,
|
||||
'error_message' => $errorMessage,
|
||||
'error_code' => $errorCode,
|
||||
'error_data' => $errorData,
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function returns array of result expected from previous function.
|
||||
*
|
||||
* @return array
|
||||
* API result array
|
||||
*/
|
||||
function mailing_submit_expectedresult() {
|
||||
|
||||
$expectedResult = array(
|
||||
'is_error' => 0,
|
||||
'version' => 3,
|
||||
'count' => 1,
|
||||
'id' => 18,
|
||||
'values' => array(
|
||||
'18' => array(
|
||||
'id' => '18',
|
||||
'domain_id' => '1',
|
||||
'header_id' => '',
|
||||
'footer_id' => '27',
|
||||
'reply_id' => '8',
|
||||
'unsubscribe_id' => '5',
|
||||
'resubscribe_id' => '6',
|
||||
'optout_id' => '7',
|
||||
'name' => 'mailing name',
|
||||
'mailing_type' => 'standalone',
|
||||
'from_name' => 'FIXME',
|
||||
'from_email' => 'info@EXAMPLE.ORG',
|
||||
'replyto_email' => 'info@EXAMPLE.ORG',
|
||||
'template_type' => 'traditional',
|
||||
'template_options' => '',
|
||||
'subject' => 'Hello {contact.display_name}',
|
||||
'body_text' => 'This is {contact.display_name}.
|
||||
https://civicrm.org
|
||||
{domain.address}{action.optOutUrl}',
|
||||
'body_html' => '<p>Look ma, magic tokens in the markup!</p>',
|
||||
'url_tracking' => '1',
|
||||
'forward_replies' => 0,
|
||||
'auto_responder' => 0,
|
||||
'open_tracking' => '1',
|
||||
'is_completed' => '',
|
||||
'msg_template_id' => '',
|
||||
'override_verp' => '1',
|
||||
'created_id' => '40',
|
||||
'created_date' => '2013-07-28 08:49:19',
|
||||
'scheduled_id' => '41',
|
||||
'scheduled_date' => '20130728085413',
|
||||
'approver_id' => '41',
|
||||
'approval_date' => '20130728085413',
|
||||
'approval_status_id' => '1',
|
||||
'approval_note' => '',
|
||||
'is_archived' => 0,
|
||||
'visibility' => 'Public Pages',
|
||||
'campaign_id' => '',
|
||||
'dedupe_email' => '1',
|
||||
'sms_provider_id' => '',
|
||||
'hash' => '67eac7789eaee00',
|
||||
'location_type_id' => '',
|
||||
'email_selection_method' => 'automatic',
|
||||
'language' => '',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return $expectedResult;
|
||||
}
|
||||
|
||||
/*
|
||||
* This example has been generated from the API test suite.
|
||||
* The test that created it is called "testMailerSubmit"
|
||||
* and can be found at:
|
||||
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php
|
||||
*
|
||||
* You can see the outcome of the API tests at
|
||||
* https://test.civicrm.org/job/CiviCRM-master-git/
|
||||
*
|
||||
* To Learn about the API read
|
||||
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
|
||||
*
|
||||
* Browse the api on your own site with the api explorer
|
||||
* http://MYSITE.ORG/path/to/civicrm/api
|
||||
*
|
||||
* Read more about testing here
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/Testing
|
||||
*
|
||||
* API Standards documentation:
|
||||
* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
|
||||
*/
|
Loading…
Add table
Add a link
Reference in a new issue