4 +--------------------------------------------------------------------+
5 | Project60 version 4.3 |
6 +--------------------------------------------------------------------+
7 | Copyright TTTP (c) 2004-2013 |
8 +--------------------------------------------------------------------+
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * File for the CiviCRM APIv3 message_template functions
31 * @package CiviCRM_SEPA
38 function civicrm_api3_message_template_create($params) {
39 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
43 * Adjust Metadata for Create action
45 * The metadata is used for setting defaults, documentation & validation
46 * @param array $params array or parameters determined by getfields
48 function _civicrm_api3_message_template_create_spec(&$params) {
49 $params['msg_title']['api.required'] = 1;
50 $params['is_active']['api.default'] = true;
51 /* $params['entity_id']['api.required'] = 1;
52 $params['entity_table']['api.default'] = "civicrm_contribution_recur";
53 $params['type']['api.default'] = "R";
58 * @param array $params
60 * @return boolean | error true if successfull, error otherwise
61 * {@getfields message_template_delete}
64 function civicrm_api3_message_template_delete($params) {
65 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
71 function _civicrm_api3_message_template_get_spec(&$params) {
75 * Retrieve one or more message_template
77 * @param array input parameters
80 * @example SepaCreditorGet.php Standard Get Example
82 * @param array $params an associative array of name/value pairs.
84 * @return array api result array
85 * {@getfields message_template_get}
88 function civicrm_api3_message_template_get($params) {
89 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
95 function civicrm_api3_message_template_send($params) {
96 CRM_Core_BAO_MessageTemplates
::sendTemplate($params);
100 * Adjust Metadata for Create action
102 * The metadata is used for setting defaults, documentation &
105 * @param array $params array or parameters determined by getfields
107 function _civicrm_api3_message_template_send_spec(&$params) {
108 $params['messageTemplateID']['api.required'] = 1;
109 $params['messageTemplateID']['title'] = 'Message Template ID';
110 $params['contactId']['api.required'] = 1;
111 $params['contactId']['title'] = 'Contact ID';
112 $params['toEmail']['api.required'] = 1;
113 $params['toEmail']['title'] = 'To Email';
114 $params['toName']['api.required'] = 1;
115 $params['toName']['title'] = 'To Name';