CloudRail is an API integration platform that has a set of free software libraries which abstract multiple external APIs from different providers, SendGrid among them, into a single and universal interface. This makes it easy to integrate many of them in your application. Abstract means that, for example, upload() works in exactly the same way for Dropbox as it does for Google Drive, OneDrive, and other Cloud Storage Services, and getEmail() works similarly the same way across all social networks.
In this tutorial, the integration of the Android SDK into an application is demonstrated with Android Java code. Gradle is used as the build tool (Android Studio standard). Head to the Website for all the details about CloudRail and instructions for other platforms.
The easiest way to integrate CloudRail for Android is via Maven. It suffices to add the following to your build.gradle:
1 2 3
After setup, sending an email with SendGrid is a breeze. Just add code like the one below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Since you’ve already integrated CloudRail SI, why not make use of some of the other APIs that come with it? Let’s use Facebook to get a user’s info to personalize the email:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
The code above assumes that “this” points to a Context (an Activity, for example, is a Context) and that you are registered as a developer with the services used (and thus possess the needed credentials). You can find more information about the functionalities and the services in the Documentation.