Twilio dependency for nameko services
pip install nameko-twilio
from nameko.rpc import rpc
from nameko_twilio import Twilio
class Service:
name = "service"
twilio = Twilio()
@rpc
def send_sms(self, number, message):
msg = self.twilio.messages.create(
number,
body=message,
from_="+1234567890"
)
return f"Message {msg.sid}"
Specify your configuration like this:
TWILIO:
SID: abcd
TOKEN: efgh