Giter VIP home page Giter VIP logo

createsend-node's People

Contributors

apmats avatar aschmid avatar dallasread avatar homerjam avatar jacwright avatar justindra avatar logicalparadox avatar ludwigw avatar methodgrab avatar nufyoot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

createsend-node's Issues

JSON.parse parser error

The JSON.parse failed and crashed our live server today. Potentially / probably bad return data from Campaign Monitor but we can't afford this crashing our server so wrap it in a try/catch like above? And/or check to ensure it's a JSON string before trying to parse?

https://github.com/nufyoot/createsend-node/blob/master/lib/interface/utils.js#L57

Error stack trace:

SyntaxError: Unexpected token <
at Object.parse (native)
at Request._callback (/var/www/dropprice1/node_modules/createsend-node/lib/interface/utils.js:55:35)
at Request.self.callback (/var/www/dropprice1/node_modules/request/request.js:368:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous> (/var/www/dropprice1/node_modules/request/request.js:1219:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/var/www/dropprice1/node_modules/request/request.js:1167:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at /var/www/dropprice1/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31

getActiveSubscribers example

rather than harassing you for full documentation, I was wondering if you could share a little insight on how to use getActiveSubscribers? I'm very new to both node and campaign monitor and struggling a bit.

what I've got:

 //more module dependancies above
 var createsend = require('createsend-node'),
 auth = { apiKey: 'XXXXXXXX' },
 api = new createsend(auth);

//unsub is my mongo schema

 unsub.statics.CMCall = function(callback){

//where do i provide the listid???

api.list.getActiveSubscribers(
    function (err, subscribers){
        for( var i = 0; i < subscribers.length; subscribers++){
            console.log(subscribers[i]);
        }
    }
  );

Post subscribers to list - unknown parameter ConsentToTrack

Hi there,

I have tried to post new subscribes to a list using the node.js wrapper and kept getting unknown parameter ConsentToTrack. This would happen every time I pass a value to the key ConsentToTrack. If I leave the value as an empty string, the POST call succeeds but that's of no use for me as I need to track users. Anyhow, I've contacted Campaign Monitor and this was their reply:

In the last few months we updated our API to v 3.2, and as such, all of our own wrappers were updated as well: https://www.campaignmonitor.com/api/wrappers/ However, as you can see there, we don't actually manage the Node wrapper solution, so it's most likely not been updated to v3.2, which would mean it doesn't support the newer Consent to Track field. You'd either need to use one of our own supported wrappers, or manage that consent to track field in app or via list imports.

This is the code I was using:

`const createsend = require('createsend-node');
const auth = { apiKey: 'api-key'};
const api = new createsend(auth);

const userName = user_first_name;
const userEmail = user_email;
const listId = 'list-id'
const details = {
EmailAddress: userEmail,
Name: userName,
"ConsentToTrack": "Unchanged"
};
api.subscribers.addSubscriber(listId, details, (err, res) => {
if (err) console.log(err);
console.log(res);
})`

Not sure it's an issue but worth flagging it here. Your feedback is much appreciated.

Alin

P.s. I got it working with the Python wrapper but I'd very much prefer node.js :D

async/await functionality

Currently, all the functions use callbacks. It would be nice to update to use promises & async/await functionality.

ESOCKETTIMEDOUT error more than one attachments to smart transactional email

I'm trying to attach two PDFs to a smart transaction email. Sending with a single attachments works fine but with two, I get the error ESOCKETTIMEDOUT

Both PDFs that I am including in the attachments array send fine on their own so it's not a file format issue.

Using latest version of this package 0.8.2

DeprecationWarning: Buffer() is deprecated due to security and usability issues.

I would like to use this on a project but when I attempt to get a list, I am getting a (node:9628) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. warning. Is this project still active or is it dead?

how to access full details about response

What seems to me from following example, is that library will return just body of response for err or data, what about headers? What if i need status code of response?

...transactional.sendSmartEmail({
  To: [...],
  Data: {...},
  smartEmailID: ...,
  clientID: ...
}, function (err, data) {
  if (err) {
    console.log('ERROR', err)
  } else {
    console.log('RESPONSE', response)
  }
})

For example if recipient is omitted, err would be:

{ 
  Code: 952,
  Message: 'Recipient is required. At least one To, CC, or a BCC address is required' 
}

addSubscriber error

I try adding a subscriber to a list:

    const api = new createsend(auth)

    const details = {
      EmailAddress: '[email protected]',
      Name: 'Joris Joris'
    }
    api.subscribers.addSubscriber('some-list-id', details, (err) => {
      if (err) {

Result:

[Error: Unable to parse JSON.  Error: Error: Can't render headers after they are sent to the client.
Body:
"[email protected]"]

Any idea what's going on?

Add API documentation

Some documentation in the readme or on a website would help show that the project is mature enough for production use. Auto-generated works for me! Keep up the great work :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.