我正在尝试使用mailchimp-api for node.js将用户emailId添加到邮件列表中。我写了以下函数。
subscribeEmail: function(listId, emailId) {
var mcapi = require("mailchimp-api");
mc = new mcapi.Mailchimp('api-key');
console.log(emailId);
mc.lists.subscribe({id: listId, email: [ {'email': emailId } ]}, function(data) {
console.log("Successfully Subscribed");
},
function(error) {
if (error.error) {
console.log(error.code + ": " + error.error);
} else {
console.log('There was an error subscribing that user');
}
});
}
我最终收到以下错误,
-100: The email parameter should include an email, euid, or leid key
是否有任何关于原因的建议。任何帮助将不胜感激。干杯!