Sidemail Node.js library
The Sidemail Node.js library provides convenient access to the Sidemail API from applications written in server-side JavaScript.
Installation
Install this package with:
npm install sidemail --save# or yarn add sidemail
Usage
First, the package needs to be configured with your project's API key, which you can find in the Sidemail Dashboard.
Here's how:
// Create Sidemail instance and set your API key.const configureSidemail = ;const sidemail = ;
Then, you can call sidemail.sendEmail
to send emails like so:
try const response = await sidemail; // Response contains email ID console; catch err // Uh-oh, we have an error! You error handling logic... console;
The response will look like this:
Learn more about Sidemail API:
Email sending examples
Send password reset email template
await sidemail;
Schedule email delivery
await sidemail;
Send email template with dynamic list
Useful for dynamic data where you have n
items that you want to render in email. For example, items in a receipt, weekly statistic per project, new comments, etc.
await sidemail;
Send custom HTML email
await sidemail;
Send custom plain text email
await sidemail;
Contacts
Create or update a contact
try const response = await sidemailcontacts; console; catch err // Uh-oh, we have an error! You error handling logic... console;
Find contact
const response = await sidemailcontacts;
List all contacts
const response = await sidemailcontacts;
and to paginate
const response = await sidemailcontacts;
Delete contact
const response = await sidemailcontacts;
More info
Visit Sidemail docs for more information.