Open keepsense opened 8 years ago
Hi, I am pretty sure that textbelt just sends a message to all emails from selected providers list.
This is the code responsible for sending messages using mutt.
region = region || 'us'; // 4
var providers_list;
if (carrier) { // 3
providers_list = carriers[carrier];
} else {
providers_list = providers[region];
}
var emails = providers_list.map(function(provider) { // 2
return provider.replace('%s', phone);
}).join(',');
var args = ['-s', 'txt', '-e', 'set from=' + config.fromAddress,
'-e', 'set use_from=yes', '-e', 'set envelope_from=yes', '-b', emails]; // 1
var child = spawn('mutt', args);
emails
as an argument (in args
). providers_list
,providers_list
is filtered at top based on the carrier
variable. if carrier
is set then emails will come from carriers[carrier]
.carrier
is not set, then providers_list
will contain emails from providers[region]
where region
will fall back to us
as default if not set.And yes, its a late answer but it might come in handy for others.
I'm sorry if this isn't the correct area to ask this. I was reviewing the code, and I see where carriers are listed by country, but I don't see the mechanism that you are using to figure out the correct carrier, and SMS gateway, for a given phone number. Do you mind sharing how you are doing that? Are you using a free service for that feature? Or, are you just sending a message to all carrier formats within that country group?
Thanks! -Ryan