I know in the iOS sdk I can do it like this
[PFCloud callFunctionInBackground:@"email" withParameters:@{@"param1": @"quantity1, @"param2": @"quantity2} block:^(NSString *result, NSError *error) {
if (error) {
//error
} else {
// make sure the set the email sent flag on the object
NSLog(@"result :%@", result);
}
}];
but how would I do this with a Javascript function