Email-On-Acid Client
This modules is a client for Email on Acid service
for testing emails.
Environment requirements
This module works in Node and Web environments
This module requires Node 7.6.0+ because of async/await syntax. For the browser,
make sure to polyfill Promise
, transpile arrow functions and async/await
syntax. This module also includes
fetch and
atob/btoa
API polyfills to be server- & client- side ready.
Installation
yarn add emailonacid-client
npm install --save emailonacid-client
Usage
const createClient = require('emailonacid-client');
try {
const client = createClient({
apiKey: process.env.EOA_API_KEY,
accountPassword: process.env.EOA_ACCOUNT_PASSWORD,
apiBaseUrl: 'https://api.emailonacid.com/v5',
clients: ['iphone6p_9', 'gmail_chr26_win', 'outlook16'],
});
const freshlyCreatedTest = await client.createTest({
subject: 'Hello'
html: '<p>Hello there</p>',
shouldBlockImages: false,
});
console.log(freshlyCreatedTest.id);
} catch (error) {
console.error(error);
}
This module also keeps static information about list of available clients.
Please keep in mind that it's collected on publish step and might be
out-of-date.
const { clients } = require('emailonacid-client');
console.log(clients);
Testing
yarn test
Publishing
yarn publish