Sending emails to friends from facebook application - php

I want to invite friends via facebook to my application. For example user can send his friends facebook IDs to my php service, and this service send them emails via facebook api. I found notifications.sendEmail function for that, but it send email only for me if I logged in FB. So, can I send invitation emails by FB api if they are not users of my application?

For sending app requests, please use https://developers.facebook.com/docs/reference/dialogs/requests/ as it is against policy for an app to automatically send app request to friends of its users. It must be user initiated and also user driven as to which friends get invited.
Also, you cannot get email addresses of a user's friends, this is also prohibited.

Related

Unable to send email to various users using MS Graph API

We want to send email to logged in users in our Drupal application. We are authenticating using AAD and our site is hosted in Azure app service.
we have a generic service account with a mailbox attached and we would like to notify the logged in users in case of any event using MS graph API and O365 connections.
Can we please get some guidance in this respect.
You can use the Graph API to send emails from your service account. Where you are going to have a problem is with identifying logged in users. An AAD token will be valid for your site even if the user originally signed in somewhere else, so logging signins isn't foolproof. Unless your users specifically sign out, the token will also be valid past when they stop using the site.
If you wanted to go down this road, then doing some logging of user actions and then sending the email to users that have been active within X amount of time might be an option.
If your goal is to notify users and you don't need an email specifically, then you might want to looking into using websockets or something similar to send notifications to the users within their browser.

how to get admin email page from facebook graph API

hello i'm trying to figure out how to get the admin page email with facebook graph API.
is there any option to get this data with the API ? or an alternative way to get this data without facebook graph API.
thanks.
On the Page endpoint there is the emails field:
The emails listed in the About section of a Page
For an App there are two fields: contact_email and user_support_email:
Email address users can use to contact developers
and
Main contact email for this app where people can receive support
The policy forbids using any other mechanism but the API to retrieve information from Facebook (e.g. scraping is not allowed).

Update Facebook Status via SMS application

We have a request from a client to update facebook status/comments through a text message.
Here is the scenario.
The SMS carries the fb Username,Password and the status/comments and this will goes to a SMS Gateway. Then the USername,Password and the status/comments come to our application and our application should facilitate to update the status and comments on the fb account.
Is there a method to authenticate the user through a SMS (Auth Dialog box) or is there any other method to update status/comments on fb through a sms. This is a PHP application.
Why don't you ask your user to create an account on your site and authorize your Facebook registered App to access his timeline? He would also register his phone number on your site and get a short numeric unique ID.
Then he can just send an SMS and when you detect a phone number or the numeric ID in a SMS, you post with the Facebook API which you are authorized for.
Sending Username and Password via SMS is not a great idea. A numeric ID of the phone number itself is much safer.
PS: I'm not using FBAPI but this is how it's supposed to work, from what I heard.
it is not possible to authenticate using username and password.
you should ask your users to create new application on their profile or authenticate first via your website in order to grant you an access.
after obtaining application_key and application_secret you can manipulate with user's account using these pairs.
please refer to facebook's developer zone to get more details on how fbapi works.

Facebook API send automated private messages to yourself

I'm using Facebook Connect on my website. I need to enable users to send themselves automated private messages from my site to their Facebook account. Does the Facebook API allow this?
Edit: I found a solution https://developers.facebook.com/docs/reference/dialogs/send/ however I need to send messages without the user interacting with the write message pop up. Messages should be sent directly if possible because they are automated, set up by the user once.
You can send to their facebook email. Facebook email is consisting profile nickname+'#facebook.com'. The email will goes to their facebook inbox message. Note that facebook email does not accept spoofing email. You will need whitelabel domain or use SendGrid.

Send Message to users inbox using PHP based facebook apps

I have created an application which can post to users wall or even send emails to selected users, what I have not been able to come up with is the functionality to let an application send a message to users facebook inbox, I have googled it and found that applications are not allowed to send messages to users inbox however there's this product called rockmelt browser which does the same thing.
There's has to be some way which allows sending messages to users inbox.
Can somebody guide me on this?
It appears that you cannot send a message to a user's inbox. The closest thing may be this http://developers.facebook.com/docs/reference/rest/livemessage.send/. It allows you to send a live message to a particular user's browser.
Hope this helps.
If you are sending the message from your application user to one of their Facebook friends, you can use a Request, which will show up in the notification area. When the user clicks on the notification, they'll be taken to your App Canvas where you can show them the full message and any other app interactions you want.

Categories