Skip to content

Commit

Permalink
Merge 1c30e9f into 1f752f7
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed May 24, 2019
2 parents 1f752f7 + 1c30e9f commit 7f9d6a2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/models/smsAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,22 @@ function buildSMSOptions(action, event) {
to: myutils.expandVar(action.parameters.to, event)
};
}

function buildTo(to) {
const splitChar = ' ';
var tos = to.split(splitChar);
var r = [];
tos.forEach(function(dest) {
r.push('tel:' + dest);
});
return r;
}

function doIt(action, event, callback) {
try {
var options, msg;
options = buildSMSOptions(action, event);
msg = { to: ['tel:' + options.to], message: options.text, from: config.sms.from };
msg = { to: buildTo(options.to), message: options.text, from: config.sms.from };

metrics.IncMetrics(event.service, event.subservice, metrics.actionSMS);

Expand Down

0 comments on commit 7f9d6a2

Please sign in to comment.