Twillio: Automatic stop after first sms response - twilio

Hi I have an automated system setup for twillio. When ever anyone texts our number we automatically respond with a thank you text. However we would like that text to be the only text that goes out. Currently if someone texts the number again responding to our thank you text, they get the same text response back. Since it's setup to trigger with any incoming sms text message. Does anyone know how to set this to just STOP after the first sms response on our part?

Its not really a twilio issue, but for every text you receive, you need to store the number in a database of some sort, and do a lookup against that table to check if a reply should be sent.
You won't be able to do this with just twiml, you'll need to add a bit of custom code in the language of your choice.

You can get the number as
from_number = request.POST.get('From', '')
and save it every number to which you send message in database.
Filter the table with number before an sms is being sent from your end.
if not from_number_exists in table:
send sms

Related

Twilio- using webhook to a second phone number to dialogue with customer

I'm using Twilio Studio and have two phone numbers.
I want to start a text conversation (A) with the customer and after a certain event (like keyword "manager") occurs, I want to alert a second text conversation (B) from a new phone number with that same customer.
I was thinking it might work to forward a message from (A) to (B), but I'm not sure how to give B the phone number that (A) was texting.
First off, I'm a newbie so take what I say with a grain of salt...
I'm almost positive there are 3 or 4 tutorials that you can link together to solve your issue. I think I've read/watched all of them 4x in the last 3 days trying to self learn.
To be honest, from what I've gathered in my self teachings your answers lie within their YouTube channel and their help docs on Functions, Webhooks, HTTP Requests and maybe even TwiML Redirects. But again, I'm a new guy.
If someone who is more knowledgeable doesn't respond back then I'll try to help you because I think I can if you can bear with me. Just reply with a tag so I'll get an alert. Good Luck (to us both!)
you can retrieve the phone number of the customer by referencing off any text you sent/received from the costumer in the flow.
For instance a if you texted them it would be {{widgets.your_widgets_name_here.outbound.To}}
Then just type in this syntax {{widgets.your_widgets_name_here.outbound.To}} in the message body of the widget you are using to alert conversation (B).
It will display the Number of the costumer.
You could then put that in the send message field of any widget in that conversation by refrencing the same way {{widgets.your_widgets_name_here.inbound.body}}

Changing messages on Slack

So I'm attempting to change a message in slack through my slackbot at the end of a chain of events. I'm able to change it for the first few instances, but I'm not able to do the very last one. I'm 99% sure that it is because I have reached the 5 interactions limit since I am indeed going through 5 interactions with the user prior to my final message. If this is the case, is there a way to change a message without server responses? I ask because the last message is simply a thank you message to the user for participating. It doesn't actually require any input from data on the server to accomplish. I feel like I read about doing it somewhere, but for the life of me I cannot find it again. Any help or links would be greatly appreciated!
EDIT: The user is interacting with buttons through interactive messages to respond to some questions. The current method of updating messages are with chat.update and setting "response_type": "ephemeral" within the json params that I am sending.
An alternative method to using chat.update is to simply reply with the message to the request from Slack. This will replace the existing message by default. It has no limit that I am aware of, so it solves your problem.
This works great with slash commands and interactive messages.
See here for more details.

Is there a way to get the inputted number aside from the Gather request?

Is there a way to get the inputted number aside from the Gather request?
Like, are they stored somewhere we can query later via the call id?
Twilio developer evangelist here.
Assuming that you mean you are looking for a way to get numbers entered into the phone's keypad during a call, then no, the only way in a Twilio call to get those digits is via the callback after using <Gather>.
If you want to store those Digits you could put them into a database, keyed with the CallSid that you receive as a parameter with every webhook too, so that you can retrieve them later.
If you are looking for the number that was dialled, that should come through as the To parameter in every TwiML request.

Matching replies using sms on twillio

I want to have a flow where I text a user, and that user can text back to trigger an event. I could have multiple outstanding messages to a user at any one time - is there anyway on receiving a text message I can figure out which message it is in reply to, without including an id number in the text message body?
Twilio evangelist here.
So, just to be clear about the problem, it sounds like you have multiple steps in your workflow that might happen in parallel, or at least before the user can response, rather than in a specific linear message/response workflow. Your app might send out 5 messages, and you want to match up each of 5 replies to a specific message.
If thats the case, then unfortunately there really isn't a direct way built into Twilio to let you match up a message reply without including some kind of ID or command in the response message.
Hope that helps.

Newsletter: How is it possible to determine how many people opened the e-mail?

Exact duplicate of Is there a way to determine whether an e-mail reaches its destination?
Hi all,
I heard that it's possible to determine how many people opened a newsletter and analyze WHEN they opened the mail.
I just wanted to know how that's possible... is it necessary to generate a "read confirmation" or is such an analysis possible without letting the recipient know?
Thanks a lot for your input...
See also Is there a way to determine whether an e-mail reaches its destination?, my answer repeated below:
If you make the email HTML based, you
can include images in it which contain
URLs with information unique to the
recipient. You could structure your
application so that these URLs trigger
some code to mark that particular
email as read before returning the
required image data.
To be totally effective, the images
would have to form a key part of the
email, so that the recipient has to
make their email client grab the
images. You could also make the plain
text part of the email just contain a
URL to retrieve the full message,
again allowing you to track receipt.
How far you take these ideas depends on why you need to know it's been read
and to what extent you want to
potentially annoy the recipient with
an email they can't cut'n'paste, read
easily on mobile device, listen to
with a screenreader, etc...
There is no way to guarantee that someone has opened your newsletter e-mail. But you can get a clue of how many time it was opened by embedding a one pixel image in you mail and use the statistics of you web server to determine how often it was requested.

Resources