Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sailthru-client

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sailthru-client - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

12

lib/sailthru_util.js
(function() {
var SailthruUtil, md5;
md5 = require('hashlib').md5;
var SailthruUtil, crypto;
crypto = require('crypto');
exports.SailthruUtil = SailthruUtil = (function() {
function SailthruUtil() {}
SailthruUtil.getSignatureHash = function(params, secret) {
return md5(SailthruUtil.getSignatureString(params, secret));
return SailthruUtil.md5(SailthruUtil.getSignatureString(params, secret));
};

@@ -12,2 +12,8 @@ SailthruUtil.getSignatureString = function(params, secret) {

};
SailthruUtil.md5 = function(data) {
var md5;
md5 = crypto.createHash('md5');
md5.update(data);
return md5.digest('hex');
};
SailthruUtil.extractParamValues = function(params) {

@@ -14,0 +20,0 @@ var k, temp, v, values;

{
"name": "sailthru-client",
"description": "Node.js client for Sailthru API",
"version": "1.0.0",
"version": "1.0.1",
"author": {

@@ -16,3 +16,2 @@ "name": "Prajwal Tuladhar",

"dependencies": {
"hashlib": ">=1.0.0"
},

@@ -19,0 +18,0 @@ "dev-dependencies": {

@@ -5,1 +5,56 @@ sailthru-node-client

A simple client library to remotely access the `Sailthru REST API` as per [http://docs.sailthru.com/api](http://docs.sailthru.com/api)
Installation
------------
### npm install sailthru-client
Examples
--------
### Initialization
var apiKey = '******',
apiSecret = '*****',
sailthru = require('sailthru-client').createSailthruClient(apiKey, apiSecret);
### [send](http://docs.sailthru.com/api/send)
//send
var template = 'my-template',
email = 'praj@sailthru.com',
options = {
'vars': {
'name': 'Prajwal Tuladhar',
'address': 'Queens, NY'
},
'options': {
'test': 1,
'replyto': 'praj@infynyxx.com'
}
};
sailthru.send(template, email, function(response, err) {
if (err) {
console.log("Status Code: " + err.statusCode);
console.log("Error Code: " + err.error);
console.log("Error Message: " + err.errormsg);
} else {
//process output
}
}, options);
//multi-send
var emails = ['praj@sailthru.com', 'ian@sailthru.com', 'will@sailthru.com'],
template = 'multi-template',
options = {
'options': {
'test': 1
}
};
sailthru.multiSend(template, emails, function(response, err) {
if (err) {
//Process error
} else {
//process JSON output
}
}, options);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc