npm install mailpro --save
MailPro = require('mailpro')
var mailPro = new MailPro({
private: "key-xxxxxxxxxxxxxxx",
public: "pubkey-xxxxxxxxxxxxx",
domain: "domain.com",
secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
});
// You can start using any of the methods below
Get a list of subscribers from a mailing list
mailPro.getSubscribers('[email protected]').then(result => {});
Create a subscriber for a selected mailing list
const user = {
address: '[email protected]',
name: 'Brandy',
vars: {} /* Variables you want to save */
};
const list = '[email protected]';
mailPro.createSubscriber(list, user).then(result => {});
Update a selected subscriber from a selected mailing list
const user = {
address: '[email protected]',
name: 'Brandy',
vars: {} /* Variables you want to save */
};
const list = '[email protected]';
mailPro.updateSubscriber(list, user).then(result => {});
Validate an email address for validity
const email = '[email protected]';
mailPro.validateEmail(email).then(valid => {});
Encrypt and Decrypt Objects
const user = {
username: 'brandy19',
age: 23,
sex: 'female',
balance: 3339.03
}
const Encrypted = mailPro.encrypt(user);
const Encrypted = '36d435ec6268244a209c1d3b5b8d12c7838f604fc907519e8e75583f1c12902f62e5da4905bea381326b893fc750c9ca913bd6d8cd9cdb13ba541329399100989ac22dfa10ab2cf9784ee8183c55fa96'
const Decrypted = mailPro.decrypt(user);
// Results -> { username: 'brandy19', age: 23, sex: 'female', balance: 3339.03 }