// @return Promise
$scope.loadTemplate = function loadTemplate(mailing, id) {
return crmMsgTemplates.get(id).then(function(tpl) {
- mailing.subject = tpl.values[0].msg_subject;
- mailing.body_text = tpl.values[0].msg_text;
- mailing.body_html = tpl.values[0].msg_html;
+ mailing.subject = tpl.msg_subject;
+ mailing.body_text = tpl.msg_text;
+ mailing.body_html = tpl.msg_html;
});
};
});
// @param id MessageTemplate id (per APIv3)
// @return Promise MessageTemplate (per APIv3)
get: function get(id) {
- return crmApi('MessageTemplate', 'get', {
- "sequential": 1,
+ return crmApi('MessageTemplate', 'getsingle', {
"return": "id,msg_subject,msg_html,msg_title,msg_text",
"id": id
});