sms.py 文件源码

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

项目:dancedeets-monorepo 作者: mikelambert 项目源码 文件源码
def send_email_link(phone_number):
    client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
    orig_get_cert_file = base.get_cert_file
    try:
        # We monkey patch the cert file to not use anything
        base.get_cert_file = lambda: None
        logging.info("Sending SMS to %s", phone_number)
        client.messages.create(
            to=phone_number,
            from_="+12566932623",
            body="Download the DanceDeets App at https://www.dancedeets.com/mobile_apps?action=download",
        )
    except TwilioRestException as e:
        if 'not a valid phone number' in e.msg:
            raise InvalidPhoneNumberException(e.msg)
        else:
            raise
    finally:
        base.get_cert_file = orig_get_cert_file
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号