The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/sms/server/SMS.js

26 lines
553 B

import { Meteor } from 'meteor/meteor';
import { settings } from '../../settings';
export const SMS = {
enabled: false,
services: {},
accountSid: null,
authToken: null,
fromNumber: null,
registerService(name, service) {
this.services[name] = service;
},
getService(name) {
if (!this.services[name]) {
throw new Meteor.Error('error-sms-service-not-configured');
}
return new this.services[name](this.accountSid, this.authToken, this.fromNumber);
},
};
settings.get('SMS_Enabled', function(key, value) {
SMS.enabled = value;
});