Send Email with Titanium and SendGrid


Posted on

TitaniumDid you know you can build native apps using web technologies? Titanium Appcelerator does exactly that. And its super easy to get up and running. To keep with the easy theme, I decided I’d develop a library for Titanium developers to simply send email using none other than our favorite email service, SendGrid!

Installation

Since Titanium uses CommonJS-compliant modules, all you have to do is drop tisendgrid.js in your lib folder. That’s it!

Example

Due to the CommonJS compliance, you are able to require a module like Node.js and such. It’s as simple as that! The library has several examples and documentation in its GitHub repository.

SMTPAPI-Example

Lets go into a more complicated example. Let’s use some SendGrid Apps (or Filters). For this demo, let’s use the Template Filter. For this we need to use the SMTPAPI Header. Thankfully, this is already built in to the library. Let’s get to the code!

Simple enough, eh? Just got yourself a simple template.

If you have any questions or concerns, feel free to reach out to me at @elbuo8.

Also, special thanks to @ricardoalcocer for the initial work on the library.


Puerto Rican and hackNY '13 fellow. Always looking to hack/experiment something new. You can follow me @elbuo8

Yamil Asusta on Twitter
Have thoughts on this post?
Chat with us about it on Twitter and Google+