首页 > 解决方案 > 根据电话号码从 Excel 工作表中提取数据的双向 SMS

问题描述

我正在尝试使用一个 API,人们会在其中回答一个文本,要么只说 Y 或 N,然后他们说他们会根据该文本回复一个文本,提供个性化信息,例如你在代码中看到的他们的名字、约会日期等等在代码中,因此每个文本都与每个人的正确信息一起发送。到目前为止,这是我分析短信和制定回复的基础,但个性化信息是我目前遇到的问题。

@app.route("/sms", methods=['GET', 'POST'])
def incoming_sms():
body = request.values.get('Body', None)

for _yes = ['y','yes','Yes','Y']
for _no = ['n','No','no','N']

if body in for_yes:
    response = notifications_client.send_sms_notification(
        phone_number = 'From Excel',
        template_id = '____', 
    personalisation = {
        'first_name': '',
        'appointment_date': '',
        'GP Name': '',

标签: pythonsms

解决方案


推荐阅读