
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
emailonacid-client
Advanced tools
This modules is a client for Email on Acid service for testing emails.
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.
# yarn
yarn add emailonacid-client
# npm
npm install --save emailonacid-client
const createClient = require('emailonacid-client');
/**
* 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 = createClient({
// Required, your API Key
apiKey: process.env.EOA_API_KEY,
// Required, your account password
accountPassword: process.env.EOA_ACCOUNT_PASSWORD,
// Optional, base Rest API URL. Defaults to value below.
apiBaseUrl: 'https://api.emailonacid.com/v5',
// Optional, list of clients to test. Defaults to value below.
clients: ['iphone6p_9', 'gmail_chr26_win', 'outlook16'],
});
/**
* 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.createTest({
// Required, mail's subject to test
subject: 'Hello'
// Required, mail's markup
html: '<p>Hello there</p>',
// Optional, flag to block images or not. Defaults to value below.
shouldBlockImages: false,
});
console.log(freshlyCreatedTest.id); // -> unqie id generated by EmailOnAcid
} 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); // <- array with available clients
yarn test
yarn publish
FAQs
Client for EmailOnAcid REST API Service
We found that emailonacid-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.