简体   繁体   中英

In Facebook do I need to check permissions before I attempt an email?

Using the API call notifications.sendEmail you can send an email to a application user that has authorised your app and granted the "email" extended permission .

Now lets pretend that I have 10 users I need to send an email to. 5 have given me this permission and 5 haven't. Is it necessary that I query FB to see if each user has given my app this permission - or can I just pass all the IDS to the sendEmail method and trust FB to send email to the 5? Will the call fail if there are any non-approved users passed?

$result = $facebook->api_client->notifications_sendEmail( 
    $user_list, 
    "The Subject", 
    "This should appear in the body (plain text)", 
    "<b><i><u>this should appear in the body</u></i></b> (HTML)"
);

http://wiki.developers.facebook.com/index.php/Notifications.sendEmail

Quote:

Returns a comma-separated list of the recipients to whom the email was successfully sent.

You can provide user IDs for users that have not granted you the email extended permission. They wouldn't get the email, but nothing else would happen. Obviously, those IDs would not appear in the return value (look at the quote above).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM