'Is it possible to relay/forward messages from contact A to contact B using Twilio on WhatsApp?
I would like to be able to have a single phone number that holds a list of contacts. And then for contact A to be able to send a message to that phone number that looks like this: "Fred: Hi fred!", which would then get relayed by Twilio and sent onward to contact B named Fred like so "Alex said: Hi fred!"
So, is it even possible to relay/forward messages from contact A to contact B using Twilio considering?
If there is what would be an indicated way to go about this in python?
Solution 1:[1]
Yes, this is absolutely possible :) In this scenario, you need a Twilio number that acts as a "Man in the middle" and forwards all messages. There is a blog post that describes almost the scenario you mentioned. The only difference is that this sample will use the phone number instead of a contact name before the colon.
+1 415 12341234: Hi, how are you doing?
+1 415 56785678: Good, any you?
Instead of
Fred: Hi, how are you doing?
Alex: Good, any you?
But it shouldn't be too hard to use a JSON object that maps names and phone numbers inside the Twilio function. If you want to go the extra mile, you could probably use an API to sync your contacts as well. But that only works if your address book/ contacts app has an API.
Solution 2:[2]
A quick google suggests the Spark JDBCDriver can use a timestamp column for partitioning . All Kedro does behind the scenes is pass the catlaog load_args and save_args to the native driver so this may work.
One another way to use a lifecycle hook like before_pipeline_run, inspect the run parameters and then inject some custom logic at that point as you're able to inspect the --params run arguments easily at that point.
A last thought - if you subclass and extend the SQL dataset you want to use you can easily extend it to partition the way you want it. You won't easily be able to pass run --params but it would be easy to retrieve env variables or custom catalog arguments.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | IObert |
| Solution 2 | datajoely |
