Notifications.sendEmail
From Facebook Developers Wiki
Contents |
[edit] Description
Sends an email to the specified users, who must have added your application. You can send five (5) emails to a user per day. Requires a session key for desktop applications, which may only send email to the person whose session it is. This method does not require a session for Web applications.
[edit] Parameters
| Required | Name | Type | Description | |
| required | api_key | string | The application key associated with the calling application. | |
|---|---|---|---|---|
| sig | string | An MD5 hash of the current request and your secret key, as described in the authentication guide. | ||
| v | string | This must be set to 1.0 to use this version of the API. | ||
| recipients | array | A comma-separated list of recipient IDs. The recipients must be people who have already added your application. You can email up to 100 people at a time. | ||
| subject | string | The subject of the email message. | ||
| optional | format | string | Desired response format. Either XML (default) or JSON. | |
| callback | string | Name of a function to call. This is primarily to enable cross-domain JavaScript requests using the <script> tag, also known as JSONP, and works with both the XML and JSON formats. The function will be called with the response passed as the parameter. | ||
| text | string | The plain text version of the email content. You must include at least one of either the fbml or text parameters. | ||
| fbml | string | The FBML version of the email. You must include at least one of either the fbml or text parameters. The fbml parameter is a stripped-down set of FBML that allows only tags that result in text, links and linebreaks. |
[edit] Example Return XML
| <?xml version="1.0" encoding="UTF-8"?> <notifications_sendEmail_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">211031,1160</notifications_sendEmail_response> |
[edit] Response
Returns a comma-separated list of the recipients to whom the email was successfully sent.
[edit] Error Codes
| Code | Description | |
| 1 | An unknown error occurred. Please resubmit the request. | |
|---|---|---|
| 2 | The service is not available at this time. | |
| 4 | The application has reached the maximum number of requests allowed. More requests are allowed once the time window has completed. | |
| 5 | The request came from a remote address not allowed by this application. | |
| 101 | The API key submitted is not associated with any known application. | |
| 102 | The session key was improperly submitted or has reached its timeout. Direct the user to log in again to obtain another key. | |
| 103 | The submitted call_id was not greater than the previous call_id for this session. | |
| 104 | Incorrect signature. |
[edit] Notes
- Tags that work: <p>, <a>, <br />
- Tags that don't work: <b>, <strong>
- Note: This list is not complete.
- FBML does not work with the
subjectparameter.
