DEV Community

tim bennett
tim bennett

Posted on

DEjango twilio mms fowarding

I have a small web page for my pigeon club. I use Twilio to send 1 direction messages. I want to be able to send a pic to the Twilio number and forward to multiple numbers. I can receive the message but do not know how to forward the image from my message. Any help would be great.

`@csrf_exempt
def mms_reply(self):
Bodyx = self.POST.get('Body')
response = MessagingResponse()
if Bodyx =='1':
msg = response.message("Gotta love a GIF!")
else:
msg = response.message("Sorry you cannot reply to this number")
from_number = self.POST.get('From', '')
#msg = response.message(from_number)

med=self.POST.get('MediaUrl[0]')
msg = response.message(str(med))
med=self.POST.get('NumMedia')
msg = response.message(str(med)+' NumMedia')
msg.media("../static/pigeonpic.jpg")
#media_link=medx
#msg.media(media_link)

return HttpResponse(str(response))
#return HttpResponse(str(Bodyx))
#../static/pigeonpic.jpg`
Enter fullscreen mode Exit fullscreen mode

Top comments (0)