{"_id":"@adeelgulzar/nodemailwizz","_rev":"3-6d8a2c616ee4033ffca9b875011fb70d","name":"@adeelgulzar/nodemailwizz","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@adeelgulzar/nodemailwizz","version":"1.0.0","description":"MailWizz implementation","author":{"name":"ADEEL GULZAR"},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/madeelgulzar/node-mailwizz.git"},"keywords":["mailwizz-api"],"license":"DO WHATEVER YOU WANT WITH THE CODE","bugs":{"url":"https://github.com/madeelgulzar/node-mailwizz/issues"},"dependencies":{"moment":"~2.24.0","request":"~2.88.0","request-promise":"~4.2.5"},"homepage":"https://github.com/madeelgulzar/node-mailwizz#readme","gitHead":"d67f24d314c49557865aff451a67c9aa271cfd3b","_id":"@adeelgulzar/nodemailwizz@1.0.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-0go5X0EPPapgKHK1bQjYMvOKLR3QwB7kdrv5e3tf6SsaSWevoqoDQLo8ooTRSFKTb0rh1V5Xb2/8XYkR/f2Mlw==","shasum":"ab4514bf7f806e6e7c85eafe91f2bf8a145f8165","tarball":"https://registry.npmjs.org/@adeelgulzar/nodemailwizz/-/nodemailwizz-1.0.0.tgz","fileCount":12,"unpackedSize":24440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/fCLCRA9TVsSAnZWagAA8zsQAIbgjvxGDAS7DbDUXXRY\nImnowpSJtqm+/RJuaASsRl/D8E/E7CRR9yy8nBEwlglIUV/KqsIUSmGnq/1l\nBdBk7KD7NQ9Sx3q8nmQqOrXHo2X7rWVoPWqqEjWG3BFIg+4GR+UFscB/hHwB\nPWyD4n3MspWwgfUpGQjFRU9yIwDPEOgtlcvhDIvYT9avuTa5LAuPAbuOrOEo\nkOqPhyvOQqVyX7xfnzqt9SwzqQ+t9+ivwRJ9db0OJgsrDvhAqs/hG+NJlyMZ\n62AsNAZQWCPs96/XmUiBz0uzxGBAd8erB4c2g6shs9VnqBuWWriZbgWxmKIl\n3Mo4C/dBzD8zxdmLkDO0/lHelDJv+z0/0xF9yebOLfIp1228ltaBEGZISa/W\nDCaO8FHacqcmyn5ryN8KWe5d4GiOqFAYh5cphrmXUgTKsvfi/eRBA6IIXZwA\nvgzetBdl7b6F4AP7QOiPzI2y76c84hdJnrn7SGvEhW20+auMPTBgQlW6Hiow\nJy5H1d9kYt0pCYbgZsQWe7fBYuK88ruy5b4MXIu5wKoCq7vYr0OARM2o0FWZ\nvHTukGD347WBQFDlWYXbEfVwwZ62U8TOSfZPSLVMQABo3PwABzs+xyWhx0dL\nJFNoh1pbuFHgp+1iZkXEJfVAtg1D3tMVnb7tHf0w/yk+ARLV1truAByJ6Abi\nPqUy\r\n=xTcK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAsJNCHFxQbSA89LEgaMTyIk0Oq3hzGe8QCiSJuYGBoEAiEAzi5/vXd5PpOIKhbkS/d5xDI14Soibdx8jy/5rE5+7EI="}]},"_npmUser":{"name":"adeelgulzar","email":"madeelgulzar@gmail.com"},"directories":{},"maintainers":[{"name":"adeelgulzar","email":"madeelgulzar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodemailwizz_1.0.0_1610477707553_0.019309854566789575"},"_hasShrinkwrap":false},"1.0.1":{"name":"@adeelgulzar/nodemailwizz","version":"1.0.1","description":"MailWizz implementation","author":{"name":"ADEEL GULZAR"},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/madeelgulzar/node-mailwizz.git"},"keywords":["mailwizz-api"],"license":"DO WHATEVER YOU WANT WITH THE CODE","bugs":{"url":"https://github.com/madeelgulzar/node-mailwizz/issues"},"dependencies":{"moment":"~2.24.0","request":"~2.88.0","request-promise":"~4.2.5"},"homepage":"https://github.com/madeelgulzar/node-mailwizz#readme","gitHead":"a93f7442d83727283a10184b6518795d1b658376","_id":"@adeelgulzar/nodemailwizz@1.0.1","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-AT2rYYp1RDXG6DCn/56gyCzeZ1tmVchcJPczMaMGxNIEuBGkJHSP0cF4+DdMeOK+1bd40fzmh7OUqmRITrpcEQ==","shasum":"fc6363eb89f3fceaec8be30316ba73ca832877c9","tarball":"https://registry.npmjs.org/@adeelgulzar/nodemailwizz/-/nodemailwizz-1.0.1.tgz","fileCount":12,"unpackedSize":24452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/fNqCRA9TVsSAnZWagAAdP4P+wfsQWUcZ4Z7nhC2RDhQ\nShfd8OFu0rJx3uYWfTHkJ+g+0XUB9EUc44Q/m8y6S9jw0WLIyra97FS8tZbX\nZxgQ5RP8iHBBOa/Cxuh3gLlCOXRImvBnaE1/beI+0jqfndMc5KimONpQyPIG\nDOVFWVax5kBem7SlkLCDC8hechFCJXI74PsqKt4caXfMqSmu7S4W5LHiLoC+\n2F4gTUPTHFUfarmefzijuCBv9jQ98LWNNcfhFYQWxysZQcstRkLoMjmEoiuW\n1ik2ZuU/nF19Qp8qx5PQq+PGn8KZwCelnTe/sgWpYJ+UnU7QdJPH2/Q5jCzR\n9ig/jghB9VZtO0jItIoeF65Ubb1rygziXDH93pTcDIka1ZvKyDtYrnqKLcaa\nAz+cujt1RWvW+bWfLNBuqyaR5M+dq5mrWla2IV3U37Su24tdW474C3xnB8CQ\n9pebnWhQW5rktCYDhFCpfY3mPOqgRDjNanT8G5XtR5XOqHMNDWUVYf0m6rJp\nAXBPOUt4BCrKzf3JUcHqbLfwmt7W/RZRU55uBKbYwHy0A+ld+a/c7tQ0bDJ5\nhggRX54THSQ4oCug0RWT8Q3lusVAT7RgLU9+hI98IDia4zI2qQxcYpWpT5Nb\npiePRg62CTBAiwiqD2/FbSsNGP+NeXsBpDDWMP4tCF/QdIiP6l9WWy5FOjRt\nV7UL\r\n=KPW7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfBGa00e9BluCXn5z2IqLFCRJLacRPmgYxzNXDL1ihEgIgUSZQmlKQiTXpke1b6KbIUcm9j7yVceFf5l4A5awyzHA="}]},"_npmUser":{"name":"adeelgulzar","email":"madeelgulzar@gmail.com"},"directories":{},"maintainers":[{"name":"adeelgulzar","email":"madeelgulzar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodemailwizz_1.0.1_1610478441903_0.7344304457960189"},"_hasShrinkwrap":false},"1.0.2":{"name":"@adeelgulzar/nodemailwizz","version":"1.0.2","description":"MailWizz implementation","author":{"name":"ADEEL GULZAR"},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/madeelgulzar/node-mailwizz.git"},"keywords":["mailwizz-api"],"license":"DO WHATEVER YOU WANT WITH THE CODE","bugs":{"url":"https://github.com/madeelgulzar/node-mailwizz/issues"},"dependencies":{"moment":"~2.24.0","request":"~2.88.0","request-promise":"~4.2.5"},"homepage":"https://github.com/madeelgulzar/node-mailwizz#readme","gitHead":"322302a4a3779ee8fd624ae5af6cdd719e8b6654","_id":"@adeelgulzar/nodemailwizz@1.0.2","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-zcI/GBDMs2zTyYjAFn7fUTzN7749bOmSbbAUcWIMbsA6HgGF35DcAV0bWI7qHxDKukXiaMR5ODcW1ZNI/h+YrA==","shasum":"9dc3541a986dcce45c5b8ecec7f0fbf283f65477","tarball":"https://registry.npmjs.org/@adeelgulzar/nodemailwizz/-/nodemailwizz-1.0.2.tgz","fileCount":12,"unpackedSize":24529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/fUICRA9TVsSAnZWagAA2Y8P/0v1BUREfL0WY/bFvQ1r\nYZttTH/Kc4y7oXK/T+CAGBSkrlA0xvv1ntCBjqJRJwEYV/iprUS41x6WtLfZ\nb0UERVNHjxhuanSYIu2D4/IkOa6vPpOCq+H9V40J9J6ZkbNk4NEUKycSy9Jf\nFs/96/Np8zjubLYtv58lFUSIC6P/FOvzhBwCgGjHwfN8fcPmZtGBB2DYfo7I\nr+jlAY9pRBlPbyhPuAsO/drgXGYfUqM7H4rJ8QPOkeFLrswqHNIOaYdw+4zr\n/wUDdxTLFw9Lq3XkVS4V+Li8O0J7VGRMjt+CooLRf67ALkVkXcAyh+Pby4sv\nP244Di2ziAPn5qpP/xcBSMCGm+z83/K/TQsf8lTPh9/S+ctj7CZd3XjY3DfC\npEu/tQfMIXqNH01vexgDRl35+MrPlapTx18BJYqEWjoR6OQ9ZeXjAhLJoend\nlW4KsbrIjvulQ+crdlFuN40HgfW2iMqlDuApmPSpQvKZscrWmXnuIcx3Gge1\n26wTLxa2PBhxe+B/AjVlfKsAuBv0lpiQeoH+BGKb2vjp7WFcotQPI06KBkvw\n6ui2EQ68HtKshwYbAb7kdiYH2js+IWoEWvBi0atG5mVlMS751UYvf+iVe9Cx\nN1xG7XEiPQVKXq3eejLaq1+AaTtzXFdK3webwJJpVqduTd1LvMQiOek2PdFB\n2T5A\r\n=ddfd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGGY1NyKIXKhCwIN/qt9Yr3lrtv5BNGpGXGZcUPrlNRQIgMi9DuCnMJt60xJvb1OPT0N8SXWw+hz9TG1LjjNPKZkw="}]},"_npmUser":{"name":"adeelgulzar","email":"madeelgulzar@gmail.com"},"directories":{},"maintainers":[{"name":"adeelgulzar","email":"madeelgulzar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodemailwizz_1.0.2_1610478855873_0.14862935435605862"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-12T18:55:07.519Z","1.0.0":"2021-01-12T18:55:07.692Z","modified":"2022-04-04T11:28:30.207Z","1.0.1":"2021-01-12T19:07:22.019Z","1.0.2":"2021-01-12T19:14:15.998Z"},"maintainers":[{"name":"adeelgulzar","email":"madeelgulzar@gmail.com"}],"description":"MailWizz implementation","homepage":"https://github.com/madeelgulzar/node-mailwizz#readme","keywords":["mailwizz-api"],"repository":{"type":"git","url":"git+https://github.com/madeelgulzar/node-mailwizz.git"},"author":{"name":"ADEEL GULZAR"},"bugs":{"url":"https://github.com/madeelgulzar/node-mailwizz/issues"},"license":"DO WHATEVER YOU WANT WITH THE CODE","readme":"\r\n[![NPM version][npm-version-image]][npm-url]\r\n# node-mailwizz\r\n\r\nI took [ntlzz93's package](https://github.com/ntlzz93/node-mailwizz-sdk) and added some more features.\r\n\r\nCurrent version is 1.0.0, feel free to make a pull request  or open an issue.\r\n\r\nTo to know which API is available and params, go to `api` directory.\r\n\r\nThis SDK are using native Promise instead of Callback, so you can async/await as you want\r\n\r\nHow to use\r\n====================\r\nFirst, you need to add the configuration:\r\n```\r\nconst mailWizz = require(\"node-mailwizz\");\r\n\r\nconst config = {\r\n    publicKey: \"publicKey\",\r\n    secret: \"secretKey\",\r\n    baseUrl: \"yourMailwizzApiUrl\"\r\n};\r\n```\r\n\r\nHow to create a subscriber:\r\n```\r\nconst subscribers = new mailWizz.ListSubscribers(config);\r\n\r\nvar userInfo = { //replace the values with your user info\r\n    EMAIL: \"contact@mikelcalvo.net\",\r\n    FNAME: \"Mikel\",\r\n    LNAME: \"Calvo\",\r\n    CUSTOM: \"custom\"\r\n};\r\n//You can replace CUSTOM with the parameters you want\r\n\r\nsubscribers.create(\"LIST-UNIQUE-ID\", userInfo)\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to update a subscriber:\r\n```\r\nconst subscribers = new mailWizz.ListSubscribers(config);\r\n\r\nvar userInfo = { //replace the values with your user's new info\r\n    EMAIL: \"contact@mikelcalvo.net\",\r\n    FNAME: \"Mikel\",\r\n    LNAME: \"Calvo\",\r\n    CUSTOM: \"custom\"\r\n};\r\n//You can replace CUSTOM with the parameters you want\r\n\r\nsubscribers.update(\"LIST-UNIQUE-ID\", \"SUBSCRIBER-UNIQUE-ID\", userInfo)\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to delete a subscriber:\r\n```\r\nconst subscribers = new mailWizz.ListSubscribers(config);\r\n\r\nsubscribers.delete(\"LIST-UNIQUE-ID\", \"SUBSCRIBER-UNIQUE-ID\")\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to unsubscribe:\r\n```\r\nconst subscribers = new mailWizz.ListSubscribers(config);\r\n\r\nsubscribers.unsubscribe(\"LIST-UNIQUE-ID\", \"SUBSCRIBER-UNIQUE-ID\")\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to get your subscribers:\r\n```\r\nconst subscribers = new mailWizz.ListSubscribers(config);\r\n\r\n/Value 1 is the page number you want to get\r\n//Value 10 is the items per package\r\n//So if you set (1, 10) it will get the first 10 subscribers\r\nsubscribers.getSubscribers(\"LIST-UNIQUE-ID\", 1, 10)\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to get a subscriber with their id:\r\n```\r\nconst subscribers = new mailWizz.ListSubscribers(config);\r\n\r\nsubscribers.getSubscriber(\"LIST-UNIQUE-ID\", \"SUBSCRIBER-UNIQUE-ID\")\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to get a subscriber with their email:\r\n```\r\nconst subscribers = new mailWizz.ListSubscribers(config);\r\n\r\nsubscribers.emailSearch(\"LIST-UNIQUE-ID\", \"SUBSCRIBER-EMAIL\")\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to get your lists:\r\n```\r\nconst lists = new mailWizz.Lists(config);\r\n\r\n//Value 1 is the page number you want to get\r\n//Value 10 is the items per package\r\n//So if you set (1, 10) it will get the first 10 lists\r\nlists.getLists(1, 10)\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nIf you have your list id you can directly get it:\r\n```\r\nconst lists = new mailWizz.Lists(config);\r\n\r\nlists.getList(\"LIST-UNIQUE-ID\")\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to create a new list:\r\n```\r\nconst lists = new mailWizz.Lists(config);\r\n\r\nvar listInfo = { //Replace the values with your list info\r\n    name: \"Main List\", //Required\r\n    description: \"This is a test list\", //Required\r\n    optIn: \"single\", //single or double\r\n    optOut: \"single\", //single or double\r\n    fromName: \"Mikel Calvo\", //Required\r\n    fromEmail: \"contact@mikelcalvo.net\", //Required\r\n    replyTo: \"contact@mikelcalvo.net\", //Required\r\n    subject: \"Hi!\",\r\n    //notification when new subscriber added\r\n    notificationSubscribe: \"yes\", //yes or no\r\n    notificationUnsubscribe: \"yes\", //yes or no\r\n    //where to send the notification\r\n    notificationSubscribeTo: \"contact@mikelcalvo.net\",\r\n    notificationUnsubscribeTo: \"contact@mikelcalvo.net\",\r\n    //This is optional, if not set customer company data will be used:\r\n    companyName: \"Mikel Calvo SL\", //required\r\n    companyCountry: \"Spain\", //required\r\n    companyZone: \"Community of Madrid\", //required\r\n    companyAddress1: \"Some street address\", //required\r\n    companyAddress2: \"\",\r\n    companyZoneName: \"\", //when country doesn't have required zone\r\n    companyCity: \"Madrid\",\r\n    companyZipCode: \"28013\",\r\n\r\n};\r\n\r\nlists.create(listInfo)\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to copy a list:\r\n```\r\nconst lists = new mailWizz.Lists(config);\r\n\r\nlists.copy(\"LIST-UNIQUE-ID\")\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n\r\nHow to remove a list:\r\n```\r\nconst lists = new mailWizz.Lists(config);\r\n\r\nlists.delete(\"LIST-UNIQUE-ID\")\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\nHow to update a list:\r\n```\r\nconst lists = new mailWizz.Lists(config);\r\n\r\nvar newInfo = { //Replace the values with your updated list info\r\n    name: \"Main List\", //Required\r\n    description: \"This is a test list\", //Required\r\n    optIn: \"single\", //single or double\r\n    optOut: \"single\", //single or double\r\n    fromName: \"Mikel Calvo\", //Required\r\n    fromEmail: \"contact@mikelcalvo.net\", //Required\r\n    replyTo: \"contact@mikelcalvo.net\", //Required\r\n    subject: \"Hi!\",\r\n    //notification when new subscriber added\r\n    notificationSubscribe: \"yes\", //yes or no\r\n    notificationUnsubscribe: \"yes\", //yes or no\r\n    //where to send the notification\r\n    notificationSubscribeTo: \"contact@mikelcalvo.net\",\r\n    notificationUnsubscribeTo: \"contact@mikelcalvo.net\",\r\n    //This is optional, if not set customer company data will be used:\r\n    companyName: \"Mikel Calvo SL\", //required\r\n    companyCountry: \"Spain\", //required\r\n    companyZone: \"Community of Madrid\", //required\r\n    companyAddress1: \"Some street address\", //required\r\n    companyAddress2: \"\",\r\n    companyZoneName: \"\", //when country doesn't have required zone\r\n    companyCity: \"Madrid\",\r\n    companyZipCode: \"28013\",\r\n\r\n};\r\n\r\nlists.update(\"LIST-UNIQUE-ID\", newInfo)\r\n    .then(function(result) {\r\n        //TODO: do what you want\r\n    })\r\n    .catch(function(err) {\r\n        //handle error here\r\n    });\r\n```\r\n[npm-url]: https://npmjs.org/package/node-mailwizz\r\n[npm-version-image]: http://img.shields.io/npm/v/node-mailwizz.svg?style=flat\r\n","readmeFilename":"README.md"}