【问题标题】:twillio studio send message flow contact.channeltwilio studio 发送消息流contact.channel
【发布时间】:2019-02-26 15:20:33
【问题描述】:

我有一个运行良好的 twillio 短信流。我只想要一个小的改进,但不知道在哪里看。在下面第二行的片段中,我想发送来电显示(contact.channel.callerId???)与号码(contact.channel.address)

{% if  trigger.message.Body  %}
SMS from {{contact.channel.address}}: 
{{  trigger.message.Body }}
{% else %}
A call was received from:  
{{contact.channel.address}}
{% endif %}

【问题讨论】:

    标签: twilio


    【解决方案1】:

    我采用了不同的方法并使用了一些 if 语句。它可能没有那么优雅,但它确实有效:

    {% if  trigger.message.Body  %}
    {% if contact.channel.address %}
    {% if  contact.channel.address ==  '+18558675309' %}
    Jack says: {{ trigger.message.Body }}
    {% endif %}
    {% if  contact.channel.address ==  '+18558675309' %}
    Buddy says: {{ trigger.message.Body }}
    {% endif %}
    {% else %}
    Unknown says: {{ trigger.message.Body }}
    {% endif %}
    {% else %}
    A call was received from:  
    {{contact.channel.address}}
    {% endif %}
    

    【讨论】:

      猜你喜欢
      • 2019-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多