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 yarn add emailonacid-client # npm npm install --save emailonacid-client
Usage
const createClient = ; /** * Make sure to catch rejections from client */try /** * Create a new client instance, this will validate credentials as well. * Please note that every API method is async and returns a Promise. * * It is recommended to store API Key and Account Password in env variables * for security reasons. Check `dotenv` module for comfortable env vars management. */ const client = ; /** * Example: creating new test. * Tests are stored for 90 days and would resolve previous (if any) cached result * if all options are same. Mails sent via utf8 encoding. */ const freshlyCreatedTest = await client; console; // -> unqie id generated by EmailOnAcid catch error console;
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 = ;console; // <- array with available clients
Testing
yarn test
Publishing
yarn publish