0

I Need to forward voicemails to Salesforce (email-to-Case) from Twilio. Currently using Studio and Twiml to execute my work flow.

There is a blog post the demonstrates how this could be done but it does not seem to work as expected.

https://support.twilio.com/hc/en-us/articles/223132287-Forwarding-Recordings-to-Your-Email

I've created and host the php file in Twilio, created a test studio flow that fire a webhook to the host url. Result - i'm able to make a call, record the voicemail but then it gives me an error and then ends the call. no email received.

``<?php

/**
* This section ensures that Twilio gets a response.
*/

header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>'; 
echo '<Response></Response>'; // Place the desired response (if any) here.

/**
* This section actually sends the email.
*/

/* Your email address. */
$to = "your-email@example.com";
$subject = "Message from {$_REQUEST['From']}";
$message = "You have received a message from {$_REQUEST['From']}.";
$message .= "To listen to this message, please visit this URL: {$_REQUEST['RecordingUrl']}";
$headers = "From: webmaster@example.com"; // Who should it come from?
mail($to, $subject, $message, $headers);``

receive an email in my mailbox as a test

Jpe
  • 1
  • I assume you hear "An application error has occurred" on the phone? Does the [debugger](https://www.twilio.com/console/debugger) inside of the Twilio console give you additional information? – stefan judis Aug 01 '19 at 09:17
  • When you say you hosted a PHP file on Twilio what do you mean? Twilio cannot and will not run PHP code for you. – philnash Aug 02 '19 at 02:30

0 Answers0