使用PHP从Facebook API的Notifications.sendEmail困难 [英] Having difficulties with Notifications.sendEmail from the Facebook API using PHP

查看:96
本文介绍了使用PHP从Facebook API的Notifications.sendEmail困难的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过Facebook API发送电子邮件。我已经添加了应用程序,并给它电子邮件扩展权限。我一直在遵循 http://wiki.developers.facebook上的说明。 com / index.php / Notifications.sendEmail ,并使用他们的示例代码(尽管使用正确的用户名代替他们列出的代码):

  $ uids = array(12345,67890,13579); 
$ csv = implode(,,$ uids);
$ result = $ facebook-> api_client-> notifications_sendEmail($ csv,Test:this should appear in the subject,This should appear in the body(plain text),Test:这应该出现在正文中< / u>< / i>< / b>(HTML))中; b>
echo发送到$ results target。 count(str_getcsv($ csv,,))。 总。;

api调用不返回错误,但$ result为空,表示没有发送任何电子邮件(已确认通过我的收件箱的空虚)。我已经尝试进出沙箱模式。要求Facebook的contact_email,proxied_email和电子邮件,都返回正确的结果。尝试发送电子邮件到由proxied_email返回的地址不会导致收到电子邮件。



我也尝试发送正常的通知和添加新闻项目到仪表板,这两个工作没有问题。我不知道我缺少什么应用程序设置或配置。任何有关疑难解答的建议都将非常感谢。

解决方案

Facebook正在转移通过API通话发送电子邮件的能力3月1日为了补偿,它们允许应用程序直接要求用户的电子邮件地址。



如果您在应用的设置中设置了电子邮件域名,那么要求电子邮件扩展权限可以让用户使用电子邮件地址,而不是通过API发送电子邮件地址。



截至3月1日,API将停止工作,您将无法自己找出自己的电子邮件解决方案。这是定期通知用户,用户和应用程序到用户,以及


I'm trying to send an email through the Facebook API. I've added the application and given it the email extended permission. I've been following the instructions at http://wiki.developers.facebook.com/index.php/Notifications.sendEmail and am using their sample code (albeit with correct userids in place of the ones they list):

$uids = array(12345,67890,13579);
$csv = implode(",", $uids); 
$result=$facebook->api_client->notifications_sendEmail($csv,"Test: this should appear in the subject", "This should appear in the body (plain text)", "Test: <b><i><u>this should appear in the body</u></i></b> (HTML)");
echo "sent to $result targets of ". count(str_getcsv("$csv",",")) . "total.";

The api call returns no errors, but $result is empty indicating none of the emails were sent (confirmed by the emptiness of my inbox). I have tried this in and out of sandbox mode. Asking facebook for contact_email, proxied_email, and email, all return correct results. Attempting to send an email to the address returned by proxied_email does NOT result in an email being received.

I've also tried sending normal notifications and adding news items to the dashboard, both of those work without problem. I'm not sure what application setting or configuration I am missing. Any suggestions for troubleshooting would be very much appreciated.

解决方案

Facebook is transitioning away from the ability to send emails via an API call on Mar. 1st. To compensate, they allow apps to now ask for a user's email address directly.

If you set the email domain in your app's settings, then asking for the email extended permission gives you the users email address instead the ability to send an email via the API.

As of Mar. 1, the API will stop working and you are left alone to figure out your own email solution. This goes for regular notifications, both user to user and app to user, as well

这篇关于使用PHP从Facebook API的Notifications.sendEmail困难的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆