Open chengtie opened 6 months ago
I tried the following code:
const { ListSubscribers } = require('node-mailwizz');
const config = {
publicKey: 'f36dd4cd40beb775068fc9650d1',
secret: 'f36dd4cd40beb775068fc9650d1',
baseUrl: 'http://mail.mycompany.com/api'
}
// Configuration details directly in the class constructor
const subscribers = new ListSubscribers(config);
// Function to search for a subscriber by email
function searchSubscriber(listUid, email) {
console.log("listUid", listUid)
console.log("email", email)
subscribers.emailSearch({
listUid: listUid,
email: email
})
.then(result => {
console.log('Subscriber found:', result);
})
.catch(err => {
console.error('Error:', err);
});
}
// Example usage of the function
searchSubscriber('en804x0lnrf1f', 'fabio.ginnetti@savoiaesavoia.it');
However, it returned
listUid en804x0lnrf1f
email fabio.ginnetti@savoiaesavoia.it
Error: {
status: 'error',
error: 'Please provide the subscriber email address.'
}
Hello,
I would like to know
Could anyone help?
Thank you