gomfunkel/node-mailchimp

Subscriber is not added to the List. why?

Closed this issue · 1 comments

I have tried and here is my code:


var cfg = require('./config'),
errorCode = require('./errorCode');

var MailChimpAPI = require('mailchimp').MailChimpAPI;

var apiKey = cfg.mailchimp_apiKey;

try {
var api = new MailChimpAPI(apiKey, { version : '1.3', secure : false });
} catch (error) {
console.log('Unable to create MailChimp: ' + error.message);
}

module.exports.listSubscribe = function(param, next){
console.log("Add " + param.email + " to " + cfg.mailchimp_subListId);
api.listSubscribe ({id:cfg.mailchimp_subListId, email_address:param.email}, function(err, data) {
if (err) {
next(errorCode.gen( '00000', JSON.stringify(err)));
} else {
next(null, data);
}
});

}

When I call this, it returns true. but, when I check my account, there is no email added to the subscribe list. Why?

OH.. find out the problem in the next moment.. THanks.