notification.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:hapi 作者: mayaculpa 项目源码 文件源码
def send(self, sender, receiver, message):
        """Send SMS Notification via Twilio."""
        try:
            Log.info("Sending SMS notification.")
            self.load_settings()
            client = TWClient(self.twilio_acct_sid, self.twilio_auth_token)
            message = client.messages.create(to=receiver, from_=sender, body=message)
            Log.info("SMS notification sent: %s", message.sid)
        except Exception as excpt:
            Log.exception("Trying to send notificaton via SMS: %s.", excpt)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号