Skip to content
Snippets Groups Projects
Commit 61f88764 authored by Kurund Jalmi's avatar Kurund Jalmi
Browse files

Merge pull request #2448 from fuzionnz/CRM-14154

CRM-14154. Add API method for "message_template", "send".
parents 7ddd8564 cd4dd9e1
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
* *
*/ */
/** /**
* @access public * @access public
*/ */
...@@ -66,9 +65,9 @@ function civicrm_api3_message_template_delete($params) { ...@@ -66,9 +65,9 @@ function civicrm_api3_message_template_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
} }
function _civicrm_api3_message_template_get_spec(&$params) { function _civicrm_api3_message_template_get_spec(&$params) {
} }
/** /**
* Retrieve one or more message_template * Retrieve one or more message_template
* *
...@@ -87,3 +86,29 @@ function civicrm_api3_message_template_get($params) { ...@@ -87,3 +86,29 @@ function civicrm_api3_message_template_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
} }
/**
* Sends a template.
*/
function civicrm_api3_message_template_send($params) {
CRM_Core_BAO_MessageTemplates::sendTemplate($params);
}
/**
* Adjust Metadata for Create action
*
* The metadata is used for setting defaults, documentation &
* validation.
*
* @param array $params array or parameters determined by getfields
*/
function _civicrm_api3_message_template_send_spec(&$params) {
$required = array(
'messageTemplateID',
'contactId',
'toEmail',
'toName',
);
foreach ($required as $value) {
$params[$value]['api.required'] = 1;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment