我正在用mailgun创建路由。 场景是我在mailgun中添加了一个域。我正在使用域的电子邮件,并在mailgun中验证了域和电子邮件。现在我正在使用mailgun从我的电子邮件向gmail发送邮件。我希望当我从gmail回复到我的电子邮件时,我可以得到通知。我创建了与收件人。@ myemail.com匹配的路由。但是我无法收到回复。 如何设置路由,以便我可以获取答复webhook。
$key = 'xyz';
$app_url = 'https://api.mailgun.net/v3/myemail.com';
$mailgunKey = "api:" . $key;
$html_content = "Hi,<br><br>You Have received $type from ".$call_info->from_phone."<br>";
$from_mail='test@myemail.com';
$html_content .= "<br>Regards,<br>";
$key1='logitaxyz@gmail.com';
$curl_post_data = [
'from' =>$from_mail,
'to' =>'User <'.$key1.'>',
'subject' =>'New Call Notification',
'html' =>$html_content,
'o:tracking-clicks' =>False
];
$service_url = $app_url.'/messages';
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, $mailgunKey);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$curl_response = curl_exec($curl);
$response = json_decode($curl_response,true);
print_r($response);