需要帮助构建twilio callend.php的php脚本

时间:2014-03-27 14:18:52

标签: php html twilio

我无法创建"点击此处"我的twilio callend.php电子邮件确认中的html元素。我需要有适当结构的帮助。

这就是我正在使用的。 echo"点击此处,部分导致电子邮件发送失败。

<?php
$recording = $_REQUEST["RecordingUrl"];

$email = "twilio@realaccesspro.com,frank@realaccesspro.com,chuck.ward@realaccesspro.com";
$from = $_REQUEST['From'];

$subject = "You Have a New Call Capture Lead " . $from;

if(strtolower($_REQUEST['TranscriptionStatus']) == "completed") {
    // email message with the text of the transcription and a link to the audio recording
    $body = "You have a new voicemail from " . $from . "\n\n";
    $body .= "Text of the transcribed voicemail:\n{$_REQUEST['TranscriptionText']}.\n\n";
    $body .= "Click this link to listen to the message:\n{$_REQUEST['RecordingUrl']}.mp3";
} else {        
    // transcription failed so just email message with just a link to the audio recording
    $body = "You have a new voicemail from " .$from . "\n\n";
    $body .= echo "<a href="{$_REQUEST['RecordingUrl']}.mp3">Click here to listen to the message:</a>\n";
    }
mail($email, $subject, $body);
?>

如何使用简单的&#34; Click Here&#34;来屏蔽通常显示在我的服务器发送的电子邮件中的URL。对此的任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

PHP的 echo 返回 void 。看起来您输出该字符串并将 void 连接到 $ body 变量。尝试删除 echo

另外,转义 href 的引号(\“)。