I have 安装了 twilio 包 https://www.twilio.com/docs/salesforce/install和以下组件。如何配置这两个组件?当客户发送短信时,它不会在沙箱中创建案例。我无法接收短信详细信息。我应该在 salesforce 中提供什么 twilio 消息 url?
我对 twilio 配置完全陌生。有人可以帮忙吗?
每当客户发送短信时,它应该使用 twilio api 自动在沙箱中创建一个案例。
组件 1:Visualforce 页面
<apex:page controller="TwilioRequestControllerContacts" action="{!init}" showHeader="false" sidebar="false">
<center>
<apex:pageBlock title="Twilio Request Listener"></apex:pageBlock>
</center>
</apex:page>
组件 2:控制器
public with sharing class TwilioRequestControllerContacts
{
public String fromNumber = ApexPages.currentPage().getParameters().get('From');
public String toNumber = ApexPages.currentPage().getParameters().get('To');
public String body = ApexPages.currentPage().getParameters().get('Body');
public PageReference init()
{
try
{
System.debug('STEP 0 FROM: ==========>' + fromNumber);
System.debug('STEP 1 TO: ===============>' + toNumber);
System.debug('STEP 2 BODY: ==========>' + body);
System.debug('STEP 3 ==============>');
String account = 'xxxxxxxxxxx';
String token = 'xxxxxxxxxxxx';
TwilioRestClient client = new TwilioRestClient(account,token);
system.debug('STEP 4 test==3>'+client);
if(fromNumber != null && toNumber != null) {
//my own logic
Case ca = new Case(Subject = fromNumber,Description = body,Origin = 'Phone');
INSERT ca;
RETURN null;
}
}
catch(exception e){
system.debug('STEP 7 error ==========>'+e);
}
RETURN null;
}
}
去看看这篇文章,这肯定会对你有帮助
http://abhithetechknight.blogspot.in/2014/06/salesforce-integration-with-twilio.html http://abhithetechknight.blogspot.in/2014/06/salesforce-integration-with-twilio.html
问候,
阿比·特里帕蒂
SFDC 认证开发商
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)