15.2.150. camcops_server.cc_modules.cc_sms¶
camcops_server/cc_modules/cc_sms.py
Copyright (C) 2012, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
This file is part of CamCOPS.
CamCOPS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
CamCOPS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
Send SMS via supported backends
- class camcops_server.cc_modules.cc_sms.ConsoleSmsBackend(config: Dict[str, Any])[source]¶
Debugging “backend” – just prints the message to the server console.
- class camcops_server.cc_modules.cc_sms.KapowSmsBackend(config: Dict[str, Any])[source]¶
Send SMS messages via Kapow.
- exception camcops_server.cc_modules.cc_sms.MissingBackendException[source]¶
SMS backend not configured.
- class camcops_server.cc_modules.cc_sms.SmsBackend(config: Dict[str, Any])[source]¶
Base class for sending SMS (text) messages.
- class camcops_server.cc_modules.cc_sms.TwilioSmsBackend(config: Dict[str, Any])[source]¶
Send SMS messages via Twilio SMS.
- camcops_server.cc_modules.cc_sms.get_sms_backend(label: str, config: Dict[str, Any]) camcops_server.cc_modules.cc_sms.SmsBackend [source]¶
Make an instance of an SMS backend by name, passing it appropriate backend-specific config options.
- camcops_server.cc_modules.cc_sms.register_backend(name: str, backend_class: Type[camcops_server.cc_modules.cc_sms.SmsBackend]) None [source]¶
Internal function to register an SMS backend by name.
- Parameters
name – Name of backend (e.g. as referred to in the config file).
backend_class – Appropriate subclass of
SmsBackend
.