lib/index.js
function(template, options){
			var payload = { data: {}, template_id: template };

			// Add root attributes to the payload root
			for(var attr in rootAttributes){
				if(!rootAttributes.hasOwnProperty(attr)){
					continue;
				}
				if(typeof options[attr] === 'undefined'){
					continue;
				}
				var key = rootAttributes[attr],
					val = options[attr];
				payload[key] = val;
				delete options[attr];
			}

			// Add any left over attribtues to the data object
			for(attr in options){
				if(!options.hasOwnProperty(attr)){
					continue;
				}
				payload.data[attr] = options[attr]
			}

			// Add to the list of emails
			this.mails.push(payload);
		}
function(template, options){
			var payload = { data: {}, template_id: template };

			// Add root attributes to the payload root
			for(var attr in rootAttributes){
				if(!rootAttributes.hasOwnProperty(attr)){
					continue;
				}
				if(typeof options[attr] === 'undefined'){
					continue;
				}
				var key = rootAttributes[attr],
					val = options[attr];
				payload[key] = val;
				delete options[attr];
			}

			// Add any left over attribtues to the data object
			for(attr in options){
				if(!options.hasOwnProperty(attr)){
					continue;
				}
				payload.data[attr] = options[attr]
			}

			// Add to the list of emails
			this.mails.push(payload);
		}
function ( template , options ) { var payload = { data : { } , template_id : template } ; // Add root attributes to the payload root for ( var attr in rootAttributes ) { if ( ! rootAttributes . hasOwnProperty ( attr ) ) { continue ; } if ( typeof options [ attr ] === 'undefined' ) { continue ; } var key = rootAttributes [ attr ] , val = options [ attr ] ; payload [ key ] = val ; delete options [ attr ] ; } // Add any left over attribtues to the data object for ( attr in options ) { if ( ! options . hasOwnProperty ( attr ) ) { continue ; } payload . data [ attr ] = options [ attr ] } // Add to the list of emails this . mails . push ( payload ) ; }
Adds a single email to the queue.

@param {string} template id
@param {object} payload data, including email address

@return {null}
Adds a single email to the queue .