CloudRail now supports email attachments

 In Product

We have just released a new feature in our email API integrations, email attachments are now supported! There are a lot of uses for email attachments, like sending automated generated documents, attaching purchased files, user guides, invoices, user generated files etc.

The email attachment feature is just an extension of the existing email integrations, so if you already use the email integration, adding an attachment is easy, as it’s just one additional parameter.

Code Sample

Let’s look at a code sample, in this case, the Android SDK is used. MailJet is used as the email service, but thanks to the unified email API, the sendMail() method is the same for all supported email services.

As mentioned, the attachment feature is an addition to the existing email integrations. An ArrayList is added as an extra parameter in the sendMail() method. This is how the ArrayList is declared:

With the additional parameter, the code for sending an email with an attachment looks like this:

That’s all there is to it. And it doesn’t matter if you are using MailJet, SendGrid or our latest email integration addition, Gmail, thanks to our unified email API.

Documentation

For more detailed information, visit our documentation page here, which also shows how to send emails with other programming languages and platforms.

Recent Posts