我想使用Twilio
函数将传入我的Twilio(虚拟)号码的任何短信转发到电子邮件地址。我该怎么做呢?
答案 0 :(得分:1)
Twilio开发者传道者在这里。
您绝对可以使用Twilio Functions将收到的短信转发到电子邮件。我实际写了blog post on how to forward SMS as email。此特定帖子使用SendGrid API发送消息,完整代码可用,并附有说明on GitHub。
如果您想使用其他服务发送电子邮件,则可以。现在有一个拉取请求,我需要查看有人添加SparkPost support的位置。只要您拥有可以作为HTTP API调用的服务,就可以使用代码并调整有效负载。
让我知道这是否有帮助。
答案 1 :(得分:0)
所以,我一直在研究这个问题,并找到了这些信息:
每当将消息发送到 twilio 号码时,也会向twilio服务器发送document.getElementById("showInvalidEmailAddress").innerHTML = '<' + getEmailValue + '>';
,并且此服务器会保存发送到该号码的消息。
要访问服务器正在保留的消息
我们在下面使用此代码。
http request
消息 重定向 到我们在那里指定的链接,并且必须是 const MessagingResponse = require('twilio').twiml.MessagingResponse;
const response = new MessagingResponse();
const message = response.message();
message.body('Hello World!');
response.redirect('https://demo.twilio.com/sms/welcome');//you need to have your own document
console.log(response.toString());
链接,您可以创建 here
所有你需要做的就是阅读信息并享受它!有关详细信息,请参阅https://www.twilio.com/docs/api/twiml/sms/your_response