nameko-twilio

Twilio dependency for nameko services


License
Apache-2.0
Install
pip install nameko-twilio==0.1

Documentation

nameko-twilio

Twilio dependency for nameko services

Installation

pip install nameko-twilio

Usage

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=f"Your mobile verification code for Invictus Capital is {payload['code']}.",
            from_="+1234567890"
        )
        return f"Message {msg.sid}"

Specify your configuration like this:

TWILIO:
  SID: abcd
  TOKEN: efgh