SendBasicEmail
Sends a simple text email to the specified user.
Service | Operation |
---|---|
SEND_BASIC_EMAIL |
Method Parameters
Parameter | Description |
---|---|
profileId | The user to send the email to |
subject | The email subject |
body | The email body |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string profileId = "f7144cc0-b996-440f-8459-21b0ecb91a10";
string subject = "Basic email subject";
string body = "This is the body of the email";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.MailService.SendBasicEmail(profileId, subject, body, successCallback, failureCallback);
const char *profileId = "f7144cc0-b996-440f-8459-21b0ecb91a10";
const char *subject = "Basic email subject";
const char *body = "This is the body of the email";
_bc->getMailService()->sendBasicEmail(profileId, subject, body, this);
NSString *profileId = @"f7144cc0-b996-440f-8459-21b0ecb91a10";
NSString *subject = @"Basic email subject";
NSString *body = @"This is the body of the email";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc mailService] sendBasicEmail:profileId
subject:subject
body:body
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String profileId = "f7144cc0-b996-440f-8459-21b0ecb91a10";
String subject = "Basic email subject";
String body = "This is the body of the email";
this; // implements IServerCallback
_bc.getMailService().sendBasicEmail(profileId, subject, body, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var profileId = "f7144cc0-b996-440f-8459-21b0ecb91a10";
var subject = "Basic email subject";
var body = "This is the body of the email";
_bc.mail.sendBasicEmail(profileId, subject, body, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var profileId = "f7144cc0-b996-440f-8459-21b0ecb91a10";
var subject = "Basic email subject";
var body = "This is the body of the email";
ServerResponse result = await _bc.mailService.sendBasicEmail(profileId:profileId, subject:subject, body:body);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var profileId = "f7144cc0-b996-440f-8459-21b0ecb91a10";
var subject = "Basic email subject";
var body = "This is the body of the email";
var mailProxy = bridge.getMailServiceProxy();
var postResult = mailProxy.sendBasicEmail(profileId, subject, body);
if (postResult.status == 200) {
// Success!
}
{
"service": "mail",
"operation": "SEND_BASIC_EMAIL",
"data": {
"profileId": "f7144cc0-b996-440f-8459-21b0ecb91a10",
"subject": "Basic email subject",
"body": "This is the body of the email"
}
}
JSON Response
{
"status": 200,
"data": {}
}