Opening a modal email window in App Cloud

The latest version of the App Cloud SDK (1.12) allows developers to launch a native modal email window inside an app instead of bouncing users into an external program (by way of a "mailto" link). Here's some sample code that shows how to listen for a "tap" event on a button before launching a modal email window:

$("#share-button").on("tap", handleShareTap);

function handleShareTap(evt) {
    var options = {
        toRecipients: "john@example.com, jane@example.com",
        subject: "Check it out!",
        body: "I found this interesting: http://www.example.com/"
    };

    var successCallback = function () {
        // sent!
    };

    var errorCallback = function (error) {
        // oh no!
        bc.device.alert(error.errorMessage);
    };

    bc.device.modalEmail.composeEmail(successCallback, errorCallback, options);
}

Of course, in your own code you'd have to pass some real data into the options object. Check out the API docs for a full rundown.

p.s. Get more tips and tricks (and share your own) by joining the Brightcove App Cloud discussion group on Google.