lib/sendgrid-provider.js
function SendgridProvider(apiUser, apiKey, options) {
	if (typeof apiUser !== 'string'
		|| typeof apiKey !== 'string') {
		throw new Error('Invalid parameters');
	}

	options = options || {};

	if (typeof options.apiSecure === 'undefined')
		options.apiSecure = true;

	options.apiHostname = options.apiHostname || 'api.sendgrid.com';
	options.apiPort = options.apiPort || (options.apiSecure ? 443 : 80);

	this.apiUser = apiUser;
	this.apiKey = apiKey;
	this.options = options;
}
function SendgridProvider(apiUser, apiKey, options) {
	if (typeof apiUser !== 'string'
		|| typeof apiKey !== 'string') {
		throw new Error('Invalid parameters');
	}

	options = options || {};

	if (typeof options.apiSecure === 'undefined')
		options.apiSecure = true;

	options.apiHostname = options.apiHostname || 'api.sendgrid.com';
	options.apiPort = options.apiPort || (options.apiSecure ? 443 : 80);

	this.apiUser = apiUser;
	this.apiKey = apiKey;
	this.options = options;
}
function SendgridProvider ( apiUser , apiKey , options ) { if ( typeof apiUser !== 'string' || typeof apiKey !== 'string' ) { throw new Error ( 'Invalid parameters' ) ; } options = options || { } ; if ( typeof options . apiSecure === 'undefined' ) options . apiSecure = true ; options . apiHostname = options . apiHostname || 'api.sendgrid.com' ; options . apiPort = options . apiPort || ( options . apiSecure ? 443 : 80 ) ; this . apiUser = apiUser ; this . apiKey = apiKey ; this . options = options ; }
Creates an instance of the SendGrid email provider.

@constructor
@this {SendgridProvider}
@param {string} apiUser API user for the SendGrid account.
@param {string} apiKey API key for the SendGrid account.
@param {object} [options] Additional optional configuration.
@param {boolean} [options.apiSecure=true] API connection protocol - true = HTTPS, false = HTTP
@param {string} [options.apiHostname=api.sendgrid.com] Hostname for the API connection
@param {number} [options.apiPort] Port for the API connection - defaults to match the protocol (HTTPS-443, HTTP-80)
Creates an instance of the SendGrid email provider .